Capacitor codes and conversions