The crystal and electronic structures of the orthorhombic compound UCoGe are presented and discussed. It has been either refined by the x-ray diffraction on a single crystal or computed within the local spin density functional theory, employing the fully relativistic version of the full-potential local-orbital band structure code, respectively. We particularly give our attention to investigating the Fermi surface and de Haas-van Alphen quantities of UCoGe. The calculated electronic density is then examined by x-ray photoelectron spectroscopy (XPS). Fairly good agreement is achieved between theoretical and experimental XPS results in the paramagnetic state. A small difference in the position (in energy scale) of the U 5f bands is caused by the electron localization effect observed in the experimental XPS. There is also some discrepancy for the Co 3d electron contributions below E-F. The Fermi surface in the non-magnetic state is of a semimetallic type while that in the ferromagnetic state, with the ordered moment of -0.47 mu(B)/f.u. along the c axis, is more metallic, with nesting properties that may favour superconductivity.