The airline, which last month reported a return to profit in the second quarter, said in a statement that the cancellation would "significantly reduce the future capital expenditure" of the company.
It said that under the cancellation agreement with Boeing, it would not have to pay compensation to the US company.
The two firms agreed that the "orders relating to the 18 B737 and 15 B787 aircraft not yet delivered shall be cancelled", it said.
"The cancellation agreement does not provide for any obligation of the Air Berlin group to make any compensation payments to Boeing", it added.
The German group will "adapt" its existing fleet by the "acquisition or leasing of suitable aircraft", although a lower number of aircraft than first planned, it said.
Boeing, confirming the cancellation in a separate statement, said its customers "operate in a dynamic environment and their overall fleet needs evolve and change".
"It is our objective to support their needs and to adapt as necessary," it said.
"Air Berlin is a long standing and valued Boeing customer and operator of a large fleet of Boeing Next-Generation 737 airplanes."
Air Berlin is due to unveil full details of a restructuring programme this month.