Home / Configs / Developer tools / .editorconfig file

.editorconfig generator: tabs, spaces and line endings

Make every editor on your team use the same indent, line endings and encoding.

For any project and any editor that supports EditorConfig (VS Code with the extension, JetBrains, Vim, Sublime and others).

An .editorconfig file keeps indent size, line endings and file encoding the same in every editor and for every person on a project. Choose your rules below and save the result in your project folder.

Create your config file

Type your own values. The file below updates as you type, and nothing you type leaves your browser.

How many columns one indent is

.editorconfig
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false

How this setup works

Diagram: .editorconfig, then Your editor, then Same style
.editorconfig (one file in the project) → Your editor (reads it on open) → Same style (for everyone)

Step-by-step setup

  1. Save the lines above as .editorconfig (with the dot) in the top folder of your project.
  2. Install the EditorConfig plugin if your editor needs one. VS Code needs the "EditorConfig for VS Code" extension, while JetBrains editors and many others read the file on their own.
  3. Reopen a file and press Tab to see the new indent.
  4. Commit the file so everyone gets the same rules.
  5. Keep the same rules in your formatter (Prettier, Black) so they do not disagree.

What the important lines mean

Common errors and how to fix them

My editor ignores .editorconfig
Some editors need a plugin. In VS Code install the EditorConfig extension. Also check the file is called exactly .editorconfig and sits in a parent folder of the file you edit.
Formatter and EditorConfig fight each other
Tools like Prettier read .editorconfig too, but a separate formatter config can override it. Make both use the same indent and line ending.
Git shows every line as changed
The line endings changed from CRLF to LF or the other way. Pick one, then run your editor's "convert line endings" or use a .gitattributes file with * text=auto.
Makefile error: missing separator
Makefiles need real tabs. Keep the Makefile section so editors do not turn tabs into spaces.

Frequently asked questions

What is an .editorconfig file?
A plain text file that sets indent style, indent size, line endings and encoding. Supported editors read it and apply the rules while you type.
Tabs or spaces?
Either works if everyone agrees. Spaces look the same everywhere. Tabs let each person choose their own width. Pick one for the project and write it here.
Do I need it if I use Prettier?
It is still useful. It makes editors follow the same rules before you format, and it covers file types Prettier does not handle.

Written for: EditorConfig specification · Updated 2026-10-11

More developer configs

See all 41 config generators