NOVELTY - Producing hydrogen and carbon dioxide, comprises providing a gaseous hydrocarbon-containing stream and converting to a stream comprising hydrogen and carbon dioxide; subjecting the converted stream to a first membrane separation step, to obtain a first hydrogen-enriched permeate stream and a first hydrogen-depleted retentate stream; and subjecting the first hydrogen-depleted retentate stream to a second membrane separation step, to obtain a second hydrogen-enriched permeate stream and a second hydrogen-depleted retentate stream.    USE - The method is useful for producing hydrogen and carbon dioxide (claimed), where the hydrogen is useful in the synthesis of ammonia and methanol, for hydrorefining and hydrotreating petroleum, for catalytic hydrogenation, for food hydrogenation, for metal annealing, for the production of hydrogen peroxide, and in fuel cells for the generation of electricity, and the carbon dioxide is useful for enhancing coal bed treatments, and in molten carbonate fuel cells greenhouses.    ADVANTAGE - The method prepares hydrogen and carbon dioxide with high yield in a cost effective manner.    DETAILED DESCRIPTION - Producing hydrogen and carbon dioxide, comprises: (a) providing a gaseous hydrocarbon-containing stream at a pressure of at least 8 bara and at a temperature above the dew point of water at the prevailing pressure; (b) converting the gaseous hydrocarbon-containing stream provided in step (a), to obtain a converted stream comprising hydrogen and carbon dioxide; (c) subjecting the converted stream to a first membrane separation step, to obtain a first hydrogen-enriched permeate stream and a first hydrogen-depleted retentate stream, where the first hydrogen-enriched permeate stream has a pressure of 1.5-80 bara; and (d) subjecting the first hydrogen-depleted retentate stream to a second membrane separation step, to obtain a second hydrogen-enriched permeate stream and a second hydrogen-depleted retentate stream.    DESCRIPTION OF DRAWING(S) - The figure shows a schematic view of a method for producing hydrogen and carbon dioxide.    Compressor (2)    Heat exchanger (3)    Gasification reactor (4)    High-temperature shift reactor (6)    Carbon dioxide separator. (12)