Kotlin Formatter

Indent Kotlin code and tidy its spacing.

Kotlin Formatter

.kt

Paste text or open a file to see the result.

What it does

Indents Kotlin code and tidies the spacing around braces and operators. Useful for Android and server code that came from different sources. Only the layout changes, so the code behaves the same.

About the .kt format

.KT file extension
File Type
Kotlin Source Code Format

Kotlin Formatter questions

How do I use the Kotlin 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 .kt 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 .kt page lists programs and converters for it.