ktfmt – pretty-prints (formats) Kotlin code

Last Updated on August 23, 2026

ktfmt is a program that pretty-prints (formats) Kotlin code, based on google-java-format.

ktfmt uses google-java-format’s underlying engine, and as such, many items on google-java-format’s FAQ apply to ktfmt as well. ktfmt ignores most existing formatting. It respects existing newlines in some places, but in general, its output is deterministic and is independent of the input code. ktfmt exposes no configuration options that govern formatting behavior.

This is free and open source software.

Website: github.com/Kotlin/ktfmt
Support:
Developer: Facebook
License: Apache License 2.0

ktfmt is written in Kotlin. Learn Kotlin with our recommended free books and free tutorials.

This article was contributed by a visitor who completed this form. Help the site by suggesting new open source software.


Related Software

Kotlin Code Formatters
ktlintKotlin linter with built-in formatter
SpotlessKeeps codebases pristine with automated formatting checks
ktfmtPretty-prints (formats) Kotlin code
ktlint-gradleRuns ktlint from Gradle to enforce Kotlin style rules
Kotlinter GradlePlugin for linting and formatting
ktlint-gradle-pluginBrings Kotlin linting and formatting checks into Gradle projects
ktfmt-gradleAdds ktfmt formatting to Gradle builds with minimal fuss.
Kotlin FormatterFormats Kotlin source with a simple, consistent command-line tool

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted