All tools Developer

.editorconfig Generator

Generate an .editorconfig with your defaults and per-file overrides.

Defaults [*] [*]

Runs in your browser. Nothing you open or type here is uploaded.

How to use

  1. Set the defaults for all files: indent style and size, line endings, charset, trailing whitespace, final newline and max line length.
  2. Add override sections for the file patterns that differ, using a preset glob or your own.
  3. Copy the generated .editorconfig, or download it, into your repository root.

Details

EditorConfig is a small file that tells every compatible editor how to format code: indentation, line endings, charset and more. VS Code needs the EditorConfig extension; JetBrains IDEs and many other editors support it natively. This tool writes a global [*] section with your defaults, plus per-file sections matched by glob patterns, each overriding only the properties it sets. Drop the file in your repository root and everyone on the team gets the same formatting without configuring their editor.

  • Set root = true in the topmost .editorconfig of your project, so settings from parent folders, such as your home directory, do not leak in.
  • end_of_line = lf keeps diffs clean when the team works across Windows and macOS or Linux.
  • A property left out of an override section inherits the global default. Only the properties a section names are overridden.

Common questions

What is .editorconfig for?

It is a small config file that tells every EditorConfig-aware editor — VS Code with the plugin, JetBrains IDEs, and many others — how to format your code: indentation, line endings, charset, and more. Drop it in your repo root and the whole team formats the same way automatically.

What does root = true do?

It tells editors to stop searching parent directories for other .editorconfig files. Set it in the topmost config of your project so settings from outside your repo, like your home directory, do not leak in.

Which properties should every project set?

At minimum: indent_style plus indent_size, end_of_line (lf keeps diffs clean across operating systems), charset (utf-8), trim_trailing_whitespace, and insert_final_newline. Add max_line_length if your team enforces one.