EditorConfig generator

Choose indentation, line endings, charset and whitespace rules and copy a ready .editorconfig. Most editors read it directly or through a plugin, so everyone on the project saves files the same way.

Which files the section applies to: * for all files, or for example *.{js,ts}. No spaces.
Indent style
Number of spaces per level, for example 2 or 4.
Line endings
A number, or off. Leave empty to omit. Not every editor enforces it.

Save the result as .editorconfig in the project root. Support is built into many editors; others need the EditorConfig plugin. Keys an editor does not know are ignored.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Leave the pattern as * to cover all files, or enter a narrower one such as *.{js,ts}.
  2. Choose spaces or tabs and, for spaces, the size.
  3. Set line endings, charset and the whitespace options.
  4. Copy the result into a file named .editorconfig at the top of your project.

What the properties mean

  • indent_style and indent_size set what the Tab key and auto-indent insert.
  • end_of_line is the line ending used when a file is saved: lf, crlf or cr.
  • charset is the file encoding: utf-8, utf-8-bom, latin1, utf-16be or utf-16le.
  • trim_trailing_whitespace and insert_final_newline clean up the end of lines and files.
  • max_line_length is a hint for editors that support it, with off to disable.

Example

The defaults produce root = true, a [*] section with two-space indentation, LF endings, UTF-8, trimming and a final newline, plus exceptions for Markdown and Makefiles.

Tips

  • If your team works on Windows and Git converts line endings, check core.autocrlf or .gitattributes so the two settings do not fight.
  • Put language-specific rules in their own sections, for example [*.py] with four spaces.

Frequently asked questions

What is an .editorconfig file?

A small text file that stores formatting rules such as indent style, line endings and charset for a folder. Editors that support EditorConfig apply the rules to files you open, regardless of personal editor settings.

What does root = true do?

EditorConfig looks for .editorconfig files in the file's folder and every parent folder. With root = true in a file, the search stops there, so a stray file higher up cannot change your rules.

Why keep trailing spaces in Markdown?

In Markdown two spaces at the end of a line make a line break. Trimming them would silently remove those breaks, so the generator adds a [*.md] section with trailing whitespace trimming turned off.

Why does Makefile get tabs?

make requires recipe lines to start with a tab character. The generator adds a [Makefile] section with indent_style = tab when your default is spaces.

Does EditorConfig format my code?

No. It sets editor behaviour for new edits: what Tab inserts, which line ending is saved. Use a formatter such as Prettier to reformat existing code.

More in Developer

All tools in this category: Developer ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.