EditorConfig Generator

Choose how your project indents, ends its lines and encodes its files. The page writes the .editorconfig file that editors read, and explains each property line with its meaning from editorconfig.org.

Free Runs in your browser Checked Tuesday, November 10, 2026

Stops editors from searching the folders above this one for another .editorconfig file. Keep it on unless a file higher up must apply too.

Indent with

Spaces or tab characters.

The number of columns in each indentation level, from 1 to 8.

Only when tabs should be drawn wider than the indent size. Leave it empty to use the indent size.

End of line

The line break written when a file is saved.

How the characters of the files are encoded.

Spaces and tabs at the end of a line are removed when a file is saved.

A line break is added at the end of a file when it is saved.

Two spaces at the end of a line make a line break in Markdown, so the .md section turns the removal off.

YAML does not allow tab characters for indentation, so the .yml and .yaml section sets spaces and an indent of two.

make needs a tab character at the start of every recipe line, so the Makefile section sets tabs.

Result

The .editorconfig file
What each line means

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Choose the indentation in Indent with and Indent size. Choose the line break in End of line and the encoding in Character set.
  2. Tick the file-type sections you need: Keep trailing spaces in Markdown, Indent YAML with two spaces and Indent Makefile recipes with tabs.
  3. Copy the text in The .editorconfig file, or download it, and save it in the top folder of your project.
  4. Read What each line means to check what every property does.

How the file works

Many editors and IDEs read an .editorconfig file and apply its settings to the files that match each section. A section header is a file-name pattern in square brackets, and the properties under it apply to every matching file. A later section overrides an earlier one for the same property. The line root = true stops the search, so the settings reach only this folder and the folders below it.

  • * matches any characters except a slash.
  • ** matches any characters, slashes included.
  • {yml,yaml} matches either text, so *.{yml,yaml} matches both kinds of file.

The file-type sections

  • Markdown: two spaces at the end of a line make a line break, so the trim is turned off for *.md.
  • YAML: tab characters are not allowed for indentation, so *.{yml,yaml} is indented with spaces, two to a level.
  • Makefile: each recipe line must start with a tab character, so Makefile gets indent_style = tab.

Choosing the values

  • Spaces are the common choice for code. Tabs suit a team whose editors all show a tab at the same width.
  • LF is the usual line break for projects on Linux and macOS and in most repositories. CRLF is the line break of Windows text files.
  • UTF-8 is the standard encoding. Use UTF-8 with a byte-order mark only when a tool needs one.

Worked example: the default choices

With spaces, an indent size of 2, LF, UTF-8, trailing spaces removed, a final line break, and the three file-type sections, the file has a root line, one section for all files with six properties, and one property in each of the Markdown and Makefile sections, plus two in the YAML section. The table lists eleven property lines, and six of them are shown here.

Section Property Value
Top of file root true
All files indent_style space
All files indent_size 2
Markdown (.md) trim_trailing_whitespace false
YAML (.yml, .yaml) indent_style space
Makefile indent_style tab

Frequently asked questions

Where should the .editorconfig file go?

In the top folder of the project, next to the README. Editors look for it in the folder of each file and then in every folder above, and the search stops at the first file that has root = true.

Does an .editorconfig file reformat my code?

Not by itself. It tells editors and plugins which indentation, line breaks and encoding to use when they edit or save a file. A formatter or a linter does the reformatting, and some of them read the same settings.

Why does the Markdown section keep trailing spaces?

In Markdown, two spaces at the end of a line make a line break. Removing them would join two lines into one, so this section turns the trim off for .md files only.

Why must a Makefile use tabs?

make reads each recipe line after a tab character, and a recipe that starts with spaces is an error. The Makefile section therefore sets indent_style to tab for files named Makefile.

Can a subfolder remove one of these settings?

Yes, with the value unset, which removes a property set earlier. This page writes plain values only, so add that line in the subfolder's own .editorconfig file if you need it.

Is the file sent to a server?

No. The file is written in your browser from the choices you make, and nothing you choose is stored.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.