Paste Java code into the upper box and press Format. The formatter runs in your browser, compiled to
WebAssembly from the same release that the other pages install: the code is
not sent anywhere, and the result is what the command line would write.
Ctrl+Enter
Loading the formatter…
Ready.
Formatted in ms.
The code does not parse; the result pane says where.
The formatter failed on this code. That is a bug: please
report it with the code.
The playground comes with the next release of open-java-format: 21.0.2, the release this
site installs, has no WebAssembly build yet. Until then the command line
gives the same result.
This browser cannot run the formatter: it needs WebAssembly garbage collection, which current Chrome,
Edge, Firefox and Safari have. The command line gives the same result.
The formatter did not load. Reload the page to try again, or use the
command line, which gives the same result.
Thank you to Denis Pavlyuchenko (@pavlyuchenko_denis on Telegram),
who suggested a playground that runs in the browser, and to cobr123, whose
WebAssembly build of the formatter this one
started from.