Increasingly strict environmental and product-quality regulations, the shrinking market for high-sulfur fuels, and the price benefit of processing heavier and sour crude oils have pushed oil refiners worldwide to increase their hydrocracking and hydrotreating capacities. Refineries in Iran are faced with low gasoline production, requirements for clean fuels and processing heavier crude oils. Solving these problems needs increased hydrocracking and hydrotreating capacities and hydrogen management in refineries. Nearly all refineries receive a large amount of hydrogen as a by-product of catalytic reforming on their site. However, current trend to reduce aromatics in gasoline are constraining the use of catalytic reforming and thus revamping a source of hydrogen is necessary. The combined effect of all these trends is that many refineries are facing a deficit of hydrogen. In this paper, relevant issues of identifying hydrogen consumers (sinks), producers (sources), optimizing hydrogen purification and recovery processes, hydrogen management in refineries and identifying bottlenecks of hydrogen by hydrogen pinch technology are discussed. To facilitate decision-making, a new software is developed in Visual Basic environment that first receives process data of existing H2 sinks and sources (flowrate, purity and pressure), and in the second step, takes required conditions. Then, it selects and recommends the best process alternatives for linking the said consumers and producers via a recovery network. The software calculates H2 pinch point, identifies purity profiles and the so-called hydrogen surplus diagram, and calculates economic issues such as simple payback time, operating cost and capital cost of the recommended network. The final process can be selected by user from among alternatives recommended by the software. Several literature problems have been solved by the software to verify its capabilities.