Formate dehydrogenases (FDHs) are considered particularly useful enzymes in biocatalysis when the regeneration of the cofactor NAD(P)H is required, that is, in chiral synthesis with dehydrogenases. Their utilization is however limited to the recycling of NAD(+), since all (apart one) of the FDHs characterized so far are strictly specific for this cofactor, and this is a major drawback for their otherwise wide applicability. Despite the many attempts performed to modify cofactor specificity by protein engineering different NAD(+)-dependent FDHs, in the general practice, glucose or phosphite dehydrogenases are chosen for the recycling of NADP(+). We report on the functional and structural characterization of a new FDH, GraFDH, identified by mining the genome of the extremophile prokaryote Granulicella mallensis MP5ACTX8. The new enzyme displays a valuable stability in the presence of many organic cosolvents as well as double cofactor specificity, with NADP(+) preferred over NAD(+) at acidic pH values, at which it also shows the highest stability. The quite low affinities for both cofactors as well as for the substrate formate indicate, however, that the native enzyme requires optimization to be applied as biocatalytic tool. We also determined the crystal structure of GraFDH both as apoprotein and as holoprotein, either in complex with NAD(+) or NADP(+). Noticeably, the latter represents the first structure of an FDH enzyme in complex with NADP(+). This fine picture of the structural determinants involved in cofactor selectivity will possibly boost protein engineering of the new enzyme or other homolog FDHs in view of their biocatalytic exploitation for NADP(+) recycling.