First-principles calculations have been used to investigate the electronic structure of a layered organic–inorganic hybrid material (WO3)2(4,4′-bipyridyl) in which the organic bipyridyl layers and the WO3 monolayers are alternately stacked. We examine the doping effects of Na and F atoms in the bipyridyl layers as typical cases of cation and anion doping, respectively. In the case of Na doping, doped electrons are mostly injected into the bipyridyl layers and the Fermi level sits in the narrow bipyridyl bands which are largely hybridized with the Na-3s orbital. It is considered to be difficult to obtain a metallic state in view of localization effects due to the randomness of doped Na, consistent with semiconducting behaviors observed in cation-doped systems. On the other hand, in the case of F doping, doped holes are mostly injected in the WO3 planes and the Fermi level sits in the wide valence bands which show almost no hybridization with the doped F orbitals resulting in cylindrical Fermi surfaces which are expected to be responsible for a metallic state in anion-doped systems.