01What is EditorConfig Generator?
EditorConfig is a small file format that tells editors how to indent and save files in a project. You commit a file called .editorconfig, and VS Code (with the EditorConfig extension), JetBrains IDEs, Vim, Neovim and many others apply it. The rules come from the spec at editorconfig.org. This generator writes that file for you, so tabs-versus-spaces stops showing up in code review. The tool works on a config object. It always writes root = true at the top, which tells editors to stop looking for more .editorconfig files in parent folders. Then comes a [*] section that matches every file. You control its indent_style, indent_size, end_of_line, charset, trim_trailing_whitespace and insert_final_newline values. The form gives you Indent Style (Spaces or Tabs), Indent Size from 1 to 8, End of Line (LF or CRLF), Charset (UTF-8, UTF-8 BOM or Latin1) and two checkboxes. Per-file sections come from three presets. Web is the default. It uses 2 spaces, with [*.md] at 2, [Makefile] on tabs, [*.{yml,yaml}] at 2 and [*.py] at 4. PHP uses 4 spaces, with 2 for JS, TS, CSS and SCSS and 4 for Markdown. Python uses 4 spaces, with 2 for JS, TS and YAML and tabs for Makefile. In EditorConfig, later sections win when more than one pattern matches a file. So a .py file in the Web preset ends up at 4 spaces even though [*] says 2. A quick worked example. Load the Web preset, switch Indent Style to Tabs, set End of Line to CRLF and untick Trim trailing whitespace. The [*] block now reads indent_style = tab, end_of_line = crlf and trim_trailing_whitespace = false. The four preset sections below it stay exactly as they were, so YAML and Python files still use spaces. There are honest limits. You can't add, edit or remove file sections in the form. They only change when you load a different preset, and the global controls never touch them. There is no switch to drop root = true. The copied text has no newline at the very end, so add one when you save the file. Also, EditorConfig only shapes new edits. Existing files keep their old formatting until you run a formatter over them. Everything runs in your browser.
Tech leads and open source maintainers who want every contributor's editor to indent and save files the same way from the first commit. The tool runs entirely in your browser, so your data never leaves your device.
02How to use EditorConfig Generator
- Pick Web project, PHP project or Python project from the examples to load the file-type sections
- Set Indent Style, Indent Size, End of Line and Charset for the [*] section
- Tick or untick Trim trailing whitespace and Final newline
- Check the .editorconfig preview, or press Reset to go back to the Web preset
- Click Copy and save the text as .editorconfig in the repository root, with a newline at the end
03Worked examples
- Input:
Web project preset (default) - Result:
root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] indent_style = space indent_size = 2 [Makefile] indent_style = tab indent_size = 4 [*.{yml,yaml}] indent_style = space indent_size = 2 [*.py] indent_style = space indent_size = 4 - Python files get 4 spaces because the [*.py] section comes after [*].
- Input:
PHP project preset - Result:
root = true [*] indent_style = space indent_size = 4 ... [*.{js,jsx,ts,tsx}] indent_style = space indent_size = 2 [*.{css,scss}] indent_style = space indent_size = 2 [*.md] indent_style = space indent_size = 4 - The [*] lines after indent_size are the same as the Web preset and are trimmed here.
- Input:
Python project preset - Result:
root = true [*] indent_style = space indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.{js,ts}] indent_style = space indent_size = 2 [Makefile] indent_style = tab indent_size = 4 [*.{yml,yaml}] indent_style = space indent_size = 2 - Makefile stays on tabs because make requires recipe lines to start with a tab character.
- Input:
Web preset, then Tabs, size 4, CRLF, Trim trailing whitespace off - Result:
root = true [*] indent_style = tab indent_size = 4 end_of_line = crlf charset = utf-8 trim_trailing_whitespace = false insert_final_newline = true [*.md] indent_style = space indent_size = 2 ... - Trimmed. Only [*] changes. The Makefile, YAML and Python sections below stay as the preset set them.
04Common use cases
- Adding a baseline .editorconfig on day one of a Node, Laravel or Django repository
- Stopping whitespace-only diffs in pull requests on a team that uses VS Code, PhpStorm and Vim side by side
- Keeping Makefile recipes on tabs while the rest of the repo uses spaces, so make doesn't fail with a missing separator error
- Forcing LF line endings so Windows contributors don't commit CRLF into a project that deploys to Linux
- Setting 4-space PHP with 2-space front-end assets in a WordPress plugin or theme repo
- Giving Prettier a shared indent and end-of-line source, since Prettier reads those keys from .editorconfig
05Tips
- VS Code ignores .editorconfig until you install the EditorConfig extension. JetBrains IDEs read it out of the box.
- Order matters. When two sections match the same file, the one lower in the file wins, so keep specific patterns after [*].
- trim_trailing_whitespace = true strips Markdown's two-space hard line breaks. Add trim_trailing_whitespace = false under [*.md] by hand if you rely on them.
- Prettier maps indent_style, indent_size and end_of_line from .editorconfig, but a .prettierrc value overrides it. Keep the two in agreement.
- UTF-8 BOM is rarely what you want for source code. Some shells and parsers choke on the leading bytes, so stick to plain UTF-8 unless a tool demands it.
06Related concepts
EditorConfig, line endings, indentation style, code formatting, UTF-8 BOM.
Frequently Asked Questions
What is EditorConfig Generator?
EditorConfig Generator is a free, browser-based developer tool on AIDToolStack. Generate .editorconfig files It requires no installation or sign-up and works entirely in your browser.
Is EditorConfig Generator free to use?
Yes. No sign-up, no fees and no usage cap.
Does EditorConfig Generator store my data?
No. It runs in your browser; nothing is uploaded.