Java Formatter

Indent Java classes and methods and tidy their braces.

Java Formatter

.java

Paste text or open a file to see the result.

What it does

Indents Java classes, methods and blocks and puts braces in one style. It helps with code pasted from chats or old projects, where the layout is mixed. You get the same Java, easier to read and review.

About the .java format

.JAVA file extension

.java Java Source Code File

Developer Files

File Type
Java Source Code File
Developer
Oracle
MIME
text/x-java-source

The JAVA file extension is just a file type that contains Java source code. It is developed by Oracle Corporation.

Java Formatter questions

How do I use the Java Formatter?

Paste the text into the Input box or open a file, set the options, then copy or download the result.

Does renaming a file to .java change its format?

No. The extension only tells programs what to expect, and the content of the file stays the same. To change the format, convert the file. The .java page lists programs and converters for it.