THE collapse of Hanjin Shipping, a South Korean container line, on August 31st brought home the extent of the storm in shipping. The firm’s bankruptcy filing left 66 ships, carrying goods worth $14.5 billion, stranded at sea. Harbours around the world, including the Port of Tokyo, refused entry for fear of going unpaid. With their stock beyond reach, American and British retailers voiced concerns about the run-up to the Christmas shopping period.

Hanjin is not alone. Of the biggest 12 shipping companies that have published results for the past quarter, 11 have announced huge losses. Several weaker outfits are teetering on the edge of bankruptcy. In Japan three firms, Mitsui OSK Lines, NYK Line and Kawasaki Kisen Kaisha, look vulnerable. Activist investors are now pressing for them to merge to avoid the same fate as the South Korean line.

Even the strongest are suffering. France’s CMA CGM, the world’s third-largest carrier, announced a big first-half loss on September 2nd. Maersk Line, the industry leader, and the largest firm within A.P. Moller-Maersk, a family-controlled Danish conglomerate, will be in the red this year, having lost $107m in the six months to June. The industry could lose as much as $10 billion this year on revenues of $170 billion, reckons Drewry, a consultancy.

Two powerful forces have rocked the industry. The first is the ebbing of world trade since the financial crisis. Two-thirds of global seaborne trade by value is carried in containers, but in 2015, for the first time since they were invented in the 1950s, (apart from the 2009 recession), global GDP grew faster than worldwide box traffic. Insipid economic growth and moribund trade liberalisation play their part; so too do shifts in manufacturing. Multinational firms are increasingly building factories in local markets; General Electric, for example, now makes engine parts where they are needed rather than shipping them from America.

The second factor is a surge in the size of the global container fleet following a ship-ordering binge that began around 2011. Overcapacity has crushed freight rates. Sending a container from Shanghai to Europe now costs half what it did in 2014, according to figures from the Chinese city’s shipping exchange.

Shipping has been through many crises but few as severe as this one. The industry may still resist doing what many recommend, which is to tackle overcapacity directly by scrapping vessels. But the depth and length of the downturn mean that firms will start doing things differently.

Eyes are trained on changes at Maersk Group in particular, which has long set the course for the industry. The Danish line has probably lost only $11 per container moved this year, less than the $100 figure for companies like Hanjin, but that is still unacceptable to its bosses and to the family that owns it. They are considering splitting up the conglomerate, and are due to announce details this month.

Maersk Group has invested in all sorts of assets since the 1960s: supermarkets, airlines and recently oil drilling, as well as shipping. The idea was to construct a hedge against falling freight rates and spikes in oil prices. When fuel is dear, squeezing container profits, drilling for oil and gas would keep it afloat, or so the thinking went. But since 2014 oil prices and freight rates have fallen together, throwing both the shipping and energy units into a sea of red ink (see chart). In June Maersk Group’s chairman, Michael Pram Rasmussen, fired Nils Smedegaard Andersen, its CEO, and replaced him with Soren Skou, the head of the container line. Mr Andersen, a former boss of Carlsberg, a Danish brewer, and the first CEO to be brought in from outside the company, was keen on retaining some diversification. Mr Skou, who has worked in shipping since he joined the group in 1983, is believed to be more sceptical.

Breakers ahead

The main part of his review of the group’s operations will seek to determine whether it should break itself into two: a separate, publicly listed shipping business, encompassing Maersk Line and the group’s port terminals and logistics arms, and another listed firm concentrating on its oil exploration and drilling businesses. That would reassure investors, worried that their money is being used to prop up failing divisions. It could widen its pool of potential investors as well as boost its value, says Neil Glynn of Credit Suisse, a bank.

The outcome of the review is still far from certain, but it is thought likely that Maersk Group will end up more focused on its roots in shipping. Mr Skou, who remains CEO of Maersk Line as well as the overall group, has said he wants to see the group’s revenues grow, and its oil division will struggle to play its part in this. One short-term but serious problem for Maersk Oil, for example, is that production could halve by 2018 because its licence to operate Qatar’s largest offshore oil field is expiring in July next year.

Maersk Line, in contrast, starts from the position of being the biggest shipping firm in the world. Yet it too has lots of work to do if it is to boost revenues and profits from shipping. A favoured cost-cutting strategy among shipping firms so far has been to form alliances. In January 2015 Maersk Line and Mediterranean Shipping Company (MSC) launched 2M, a partnership to share space on their vessels. This April four others got together, followed by six more in May. These three groups now account for nearly three-quarters of the global market. But alliances do not solve the problem of overcapacity and they have not stopped freight rates from falling.

Another tack has been to build bigger ships. “When oil prices were high we built bigger ships and pioneered slow steaming to save bunker costs,” says Soren Toft, Mr Skou’s COO and right-hand man. Maersk Line built 20 huge “Triple-E” class vessels that could carry just under 20,000 containers each; its biggest rivals, MSC and CMA CGM, followed its lead. But with fuel prices much lower—in 2015 they accounted for less than 13% of Maersk Line’s costs—the savings are slim. After the last Triple-E ship entered service last year, it cut back on ordering new vessels.

Maersk Group’s big new idea is to make its existing ships smarter. Mr Toft says Maersk Line will focus on using these ships better by embracing the “age of digitisation”. This is an area in which shipping lags well behind other sectors, such as aerospace. Whereas a modern jetliner creates several terabytes of data a day, it takes the average cargo ship 50 days to produce a single one. Most ships do not even have basic sensors to ensure their hatches are closed before leaving port. Until very recently the industry resisted using data properly, says Martin Stopford, president of Clarkson Research, part of a shipbroker. Now it cannot afford to ignore systems that offer the chance of reducing costs by up to 30% by better co-ordinating the interaction of ships and shore, he says.

Maersk Line is retrofitting its ships to collect more data. Last year it installed sensors on its containers that track their location and contents. That makes it easier for port terminals to handle them, so ships can leave and start earning money again more quickly. Software also works out how to stack containers on ships more efficiently.

Empty containers are another drain, costing shipping lines up to $20 billion a year, according to BCG, another consultancy. Maersk Line is not the only one using data to deal with this problem. Japan’s NYK saved over $100m by getting better at spotting and using empty containers. A new website called xChange, which started operating last November, allows shipping lines to swap spare containers among themselves to maximise efficiency.

The Danish firm’s three-year-old analytics team has also worked on discovering the optimal speed and course for its ships. They are trying to cut its big repair bills, too. The hope is that predictive maintenance could achieve this quickly. Instead of waiting for ship engines to break down, sensors will report when they need care.

What Maersk Line does in digitisation is likely to be followed by the rest of the industry in fairly short order. As an executive at one of Maersk Line’s rivals admits: “We just watch what Maersk does and copy it.” And although few shipping outfits have the resources to build ever bigger ships, even the smallest of them can learn to use data better. Data crunching alone will not save the industry from the current storm; that will require ships to be scrapped. But it may prepare it better for the next one.