Wastewater gas recovery system for recovering NH 3 and CO 2 comprising at least one ion exchange unit, each exchange unit comprising at least three ion exchange compartments (31,32,33), each ion exchange compartment being in contact over a membrane with at least one adjacent compartment, a first alkaline ion exchange compartment being in fluidic contact with a positive side of first bipolar membrane and with a cation exchange membrane and comprising aqueous NH 4 + and OH-, a second ion exchange compartment being in fluidic contact with an anion exchange membrane and with a cation exchange membrane and comprising water, NH 4 +, and HCO 3 -, and a third acidic ion exchange compartment being in fluidic contact with a negative side of a bipolar membrane and with an anion exchange membrane and comprising aqueous H+ and HCO 3 -, a wastewater input for providing wastewater to the second compartment, a treated water output adapted to receive output from the second compartment, a cathode and an anode for providing a voltage, at least two electrode rinse compartments (21,22) being in electrical contact with the cathode or with the anode and with a membrane (11a,11b,12,13), and comprising salt, at least three recirculation units (51,52,74a,74b), including a first alkaline recirculation unit adapted to receive input from the first alkaline compartment, comprising a pump, a gaseous ammonia stripper, and for providing stripped output to the first alkaline compartment, a second acidic recirculation unit adapted to receive input from the third acidic compartment, comprising a pump, a gaseous CO 2 stripper, and for providing stripped output to the third acidic compartment, and a third recirculation unit (74a,74b) adapted to receive input from a first electrode rinse compartment, in electrical contact with the anode, and for providing output to a second electrode rinse compartment, in electrical contact with the cathode, and vice versa, wherein at least one of the gaseous ammonia stripper and of the gaseous CO 2 stripper comprises a hydrophobic membrane (61a,62a), a molecular sieve for ammonia or for CO 2, respectively a pervaporation membrane, or a combination thereof, and a tube for removing gaseous ammonia, and a tube for removing gaseous CO 2. at least one ion exchange unit, each exchange unit comprising at least three ion exchange compartments (31,32,33), each ion exchange compartment being in contact over a membrane with at least one adjacent compartment, a first alkaline ion exchange compartment being in fluidic contact with a positive side of first bipolar membrane and with a cation exchange membrane and comprising aqueous NH 4 + and OH-, a second ion exchange compartment being in fluidic contact with an anion exchange membrane and with a cation exchange membrane and comprising water, NH 4 +, and HCO 3 -, and a third acidic ion exchange compartment being in fluidic contact with a negative side of a bipolar membrane and with an anion exchange membrane and comprising aqueous H+ and HCO 3 -, a first alkaline ion exchange compartment being in fluidic contact with a positive side of first bipolar membrane and with a cation exchange membrane and comprising aqueous NH 4 + and OH-, a second ion exchange compartment being in fluidic contact with an anion exchange membrane and with a cation exchange membrane and comprising water, NH 4 +, and HCO 3 -, and a third acidic ion exchange compartment being in fluidic contact with a negative side of a bipolar membrane and with an anion exchange membrane and comprising aqueous H+ and HCO 3 -, a wastewater input for providing wastewater to the second compartment, a treated water output adapted to receive output from the second compartment, a cathode and an anode for providing a voltage, at least two electrode rinse compartments (21,22) being in electrical contact with the cathode or with the anode and with a membrane (11a,11b,12,13), and comprising salt, at least three recirculation units (51,52,74a,74b), including a first alkaline recirculation unit adapted to receive input from the first alkaline compartment, comprising a pump, a gaseous ammonia stripper, and for providing stripped output to the first alkaline compartment, a second acidic recirculation unit adapted to receive input from the third acidic compartment, comprising a pump, a gaseous CO 2 stripper, and for providing stripped output to the third acidic compartment, and a third recirculation unit (74a,74b) adapted to receive input from a first electrode rinse compartment, in electrical contact with the anode, and for providing output to a second electrode rinse compartment, in electrical contact with the cathode, and vice versa, wherein at least one of the gaseous ammonia stripper and of the gaseous CO 2 stripper comprises a hydrophobic membrane (61a,62a), a molecular sieve for ammonia or for CO 2, respectively a pervaporation membrane, or a combination thereof, and a tube for removing gaseous ammonia, and a tube for removing gaseous CO 2. ammonia stripper and of the gaseous CO 2 stripper comprises a hydrophobic membrane (61a,62a), a molecular sieve for ammonia or for CO 2, respectively a pervaporation membrane, or a combination thereof, and a tube for removing gaseous ammonia, and a tube for removing gaseous CO 2.