A process for treating a hydrogen pressure swing adsorption tail gas stream that contains hydrogen, carbon monoxide, carbon dioxide, methane and water in order to recover high purity carbon dioxide from the tail gas stream, said process comprising the steps of: a) introducing the hydrogen pressure swing adsorption tail gas into a compressor in order to compress the tail gas; b) introducing the compressed hydrogen pressure swing adsorption tail gas into one of a carbon dioxide pressure swing adsorption unit or a carbon dioxide pressure vacuum swing adsorption unit that contains one or more beds of an adsorbent selected from activated carbon, silica gels, one or more zeolites or any combination thereof thereby allowing for the recovery of a secondary high purity gaseous carbon dioxide stream by adsorption of the carbon dioxide to the adsorbent and a secondary carbon dioxide lean gas stream; c) allowing the secondary carbon dioxide lean gas stream to pass from the carbon dioxide pressure swing adsorption unit or respectively from the carbon dioxide pressure vacuum swing adsorption unit to a membrane separation unit that includes a membrane that is highly selective for hydrogen and carbon dioxide, said membrane having a residue side and a permeate side, the membrane allowing for the retention of methane and carbon monoxide to form a first membrane stream on the residue side of the membrane and the passing of carbon dioxide and hydrogen to the permeate side to form a second membrane stream on the permeate side of the membrane; d) recompressing the first membrane stream and recycling the compressed first membrane stream as feed gas for a steam hydrocarbon reformer or as makeup fuel for a steam hydrocarbon reformer; e) optionally recompressing the second membrane stream in a third compressor and recycling this compressed second membrane stream to the water gas shift effluent to be introduced into the hydrogen pressure swing adsorption unit or passing the second membrane stream to the hydrogen pressure swing adsorption tail gas to be compressed before being injected into the carbon dioxide pressure swing adsorption unit or respectively the carbon dioxide pressure vacuum swing adsorption unit; and f) removing the carbon dioxide that is adsorbed onto the one or more beds of the carbon dioxide pressure swing adsorption unit or respectively of the carbon dioxide pressure vacuum swing adsorption unit by decompressing the one or more beds in order to produce a high purity gaseous carbon dioxide stream. a) introducing the hydrogen pressure swing adsorption tail gas into a compressor in order to compress the tail gas; b) introducing the compressed hydrogen pressure swing adsorption tail gas into one of a carbon dioxide pressure swing adsorption unit or a carbon dioxide pressure vacuum swing adsorption unit that contains one or more beds of an adsorbent selected from activated carbon, silica gels, one or more zeolites or any combination thereof thereby allowing for the recovery of a secondary high purity gaseous carbon dioxide stream by adsorption of the carbon dioxide to the adsorbent and a secondary carbon dioxide lean gas stream; c) allowing the secondary carbon dioxide lean gas stream to pass from the carbon dioxide pressure swing adsorption unit or respectively from the carbon dioxide pressure vacuum swing adsorption unit to a membrane separation unit that includes a membrane that is highly selective for hydrogen and carbon dioxide, said membrane having a residue side and a permeate side, the membrane allowing for the retention of methane and carbon monoxide to form a first membrane stream on the residue side of the membrane and the passing of carbon dioxide and hydrogen to the permeate side to form a second membrane stream on the permeate side of the membrane; d) recompressing the first membrane stream and recycling the compressed first membrane stream as feed gas for a steam hydrocarbon reformer or as makeup fuel for a steam hydrocarbon reformer; e) optionally recompressing the second membrane stream in a third compressor and recycling this compressed second membrane stream to the water gas shift effluent to be introduced into the hydrogen pressure swing adsorption unit or passing the second membrane stream to the hydrogen pressure swing adsorption tail gas to be compressed before being injected into the carbon dioxide pressure swing adsorption unit or respectively the carbon dioxide pressure vacuum swing adsorption unit; and f) removing the carbon dioxide that is adsorbed onto the one or more beds of the carbon dioxide pressure swing adsorption unit or respectively of the carbon dioxide pressure vacuum swing adsorption unit by decompressing the one or more beds in order to produce a high purity gaseous carbon dioxide stream.