Home › Developer Tools › EditorConfig Generator

EditorConfig Generator

Build an .editorconfig file that keeps indentation, line endings and whitespace consistent across every editor your team uses. Start from a language preset, adjust each file pattern, and test which rules apply to any path before you commit it.

Last updated:

Sections

Quick add:

.editorconfig

Save it as .editorconfig (with the leading dot) in your project root. If your browser drops the dot when downloading, rename the file.

Advertisement
Advertisement

How to use the EditorConfig Generator

  1. Pick a preset for your main language and click Load preset, or import an existing .editorconfig.
  2. Edit the sections: change the file pattern in brackets and choose values for each property. Leave a property as (not set) to keep the editor's default.
  3. Add sections for special files with the quick-add buttons, for example Makefiles that need tabs or Markdown that keeps trailing spaces.
  4. Test a path such as src/app.ts to see the matching sections and the settings an editor will use.
  5. Copy or download the file and save it as .editorconfig in the root of your project.

EditorConfig properties reference

PropertyValuesWhat it controls
roottrueTop of the file only (outside any section): stop looking for .editorconfig files in parent folders.
indent_stylespace, tabWhether the Tab key and auto-indent insert spaces or tab characters.
indent_sizewhole number, tabColumns per indentation level.
tab_widthwhole numberDisplay width of a tab character; defaults to indent_size.
end_of_linelf, crlf, crLine break written when saving: LF for Unix/macOS, CRLF for Windows.
charsetutf-8, utf-8-bom, latin1, utf-16be, utf-16leFile encoding. Use utf-8 unless a tool needs a BOM.
trim_trailing_whitespacetrue, falseRemove spaces at the ends of lines on save.
insert_final_newlinetrue, falseMake sure the file ends with a line break.
max_line_lengthwhole number, offGuide or wrap column; supported by some editors only.

Any property can also be set to unset, which removes a value inherited from an earlier section so the editor falls back to its own default. Property names and values are case-insensitive.

Glob patterns cheat sheet

PatternMatches
*Any string except /; [*] on its own matches every file
**Any string including /, so src/**.ts matches TypeScript files at any depth under src
?Exactly one character (not /)
[abc], [!abc]One character from the set, or not in the set
{js,ts,tsx}Any of the comma-separated alternatives, e.g. *.{js,ts,tsx}
{1..5}Any whole number from 1 to 5, e.g. chapter{1..5}.md

Pair EditorConfig with a formatter for full consistency: the Prettier Config Generator builds a matching .prettierrc, and Prettier reads indent_style, indent_size/tab_width, max_line_length and end_of_line from .editorconfig when they are not set in its own config.

Frequently asked questions

What is an .editorconfig file?

It is a small INI-style text file that tells code editors how to format files in a project: spaces or tabs, indent width, line endings, character set and whitespace trimming. Many editors read it natively (JetBrains IDEs, Visual Studio, Vim, Neovim, GitHub's web editor) and others such as VS Code need the EditorConfig extension.

Where do I put the .editorconfig file?

Save it in the root folder of your repository and commit it. Editors look for .editorconfig in the file's folder and every parent folder; root = true in the top file stops that search so settings from outside the project are ignored.

How do sections and patterns work?

Each [section] header is a file pattern. Later sections override earlier ones for the properties they set, so put [*] defaults first and specific patterns after it. A pattern without a slash, such as *.md, matches files in any folder; a pattern with a slash, such as lib/**.js, is relative to the folder containing .editorconfig.

What is the difference between indent_size and tab_width?

indent_size is how many columns one indentation level uses. tab_width is how wide a tab character is displayed. If you indent with spaces you normally only set indent_size; tab_width defaults to the same value. Setting indent_size = tab means one indent equals one tab of tab_width columns.

Does EditorConfig reformat my existing files?

No. It only changes how editors behave when you type and save: new indentation, the line endings written, trimming trailing spaces on save and so on. Existing files keep their formatting until edited or run through a formatter like Prettier.

Is max_line_length supported everywhere?

No. max_line_length is a domain-specific property that some editors honour (JetBrains IDEs, Vim with the plugin, Emacs) while others ignore it. Formatters such as Prettier read it as printWidth when no other setting is given.

Is anything uploaded?

No. The file is generated in your browser. Your last configuration is saved only in this browser's local storage so it is there when you come back.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Prettier Config GeneratorToggle Prettier options, preview formatted code live and copy your .prettierrc file.ESLint Config GeneratorGenerate a flat eslint.config.js for JavaScript, TypeScript, React or Node with rule presets.Gitignore GeneratorBuild a .gitignore from 50+ templates for languages, frameworks, IDEs and OS, merged and deduped.package.json GeneratorFill a form and get a valid, npm-ready package.json with scripts, dependencies and checks.Online Python CompilerRun Python 3 in your browser with input(), numpy, pandas, charts and share links.JSON EditorEdit JSON in a tree and as code side by side: add, rename, drag, change types, undo and download.Unzip FilesOpen and extract ZIP files online.RAR & 7z ExtractorOpen RAR, 7z and other archives online and extract files.Regex TesterTest and debug regular expressions live.File Info ViewerCheck file size, type, date and MD5/SHA hashes.SQLite ViewerOpen .db and .sqlite files in your browser, browse tables and run SQL queries.DOCX ViewerOpen and read Word .docx files in your browser, then print or save them as HTML.EPUB ReaderOpen and read EPUB e-books in your browser with pages, a table of contents and font controls.What Is My BrowserSee your browser, version, OS, engine, screen and which web features it supports.Font ViewerPreview TTF, OTF, WOFF and WOFF2 fonts with sample text, waterfall, glyphs and metadata.Markdown EditorWrite Markdown with a toolbar, live split preview, autosave and .md or HTML export.Regex Cheat Sheet75+ ready-to-use regex patterns for emails, URLs, IPs and dates, each with a live test box.JavaScript Keycode FinderPress any key to see its JavaScript key, code, keyCode, which, location and modifiers.QR Code ScannerScan QR codes with your camera or from an image and safely read the link or text.RAID CalculatorUsable capacity, efficiency and fault tolerance for RAID 0, 1, 5, 6, 10, 50 and 60 arrays.JSONPath TesterTest JSONPath expressions live: filters, slices, wildcards and recursive search, with matches highlighted.Mermaid Diagram EditorWrite Mermaid code and see flowcharts, sequence, Gantt and ER diagrams live. Export SVG or PNG.Country Codes ListSearch ISO 3166 alpha-2, alpha-3 and numeric country codes with calling codes and TLDs.CSS Selector TesterTest CSS selectors on your HTML: highlighted matches, match count and specificity.Git Cheat SheetSearchable Git command reference by task, with copy buttons and an undo/rename/fix wizard.HAR File ViewerOpen a .har file to see a waterfall timeline, headers, bodies, timings and size totals.jq PlaygroundRun jq filters on JSON in your browser with live output, flags and an example library.Markdown Cheat SheetInteractive Markdown syntax reference: edit every example and see the live rendered preview.Regex ExplainerPaste a regular expression and get a plain-English breakdown, railroad diagram and flag notes.XPath TesterTest XPath expressions on XML or HTML: highlighted matches, node paths, values and examples.EML File ViewerOpen .eml email files to read the message, headers and raw source and save attachments.Graphviz Online ViewerWrite Graphviz DOT code and render graphs live; switch layout engines, export SVG or PNG.JavaScript Online CompilerWrite and run JavaScript in your browser with a console, timing, error lines and share links.Jupyter Notebook ViewerOpen .ipynb files and read code, Markdown, math, tables, plots and errors without Python.LaTeX Table GeneratorEdit a table like a spreadsheet or paste from Excel and get LaTeX tabular or booktabs code.Log File ViewerOpen huge log files with level colors, regex and time filters, JSON pretty-print and tail -f.Logic Gate SimulatorBuild logic circuits with AND, OR, NOT, XOR gates and flip-flops; see live outputs and truth tables.MSG File ViewerOpen Outlook .msg emails in your browser: sender, recipients, body, headers and attachments.Online Code EditorVS Code-style editor in your browser: tabs, 50+ languages, find/replace, autosave.Online Hex EditorOpen any file as hex and ASCII, edit bytes, search, inspect values and save the result.PHP Online CompilerRun PHP 8 code in your browser with output, HTML preview, error lines and share links.PlantUML EditorWrite PlantUML and see sequence, class, activity and more diagrams live. Export SVG or PNG.Sorting Algorithm VisualizerWatch bubble, insertion, merge, quick, heap and radix sort step by step with live counters.Lottie ViewerOpen Lottie JSON or .lottie files to play, pause, scrub frames, change speed and see details.Diff ViewerPaste a git diff or .patch file and view it side by side or inline, with file navigation.Folder Compare ToolCompare two folders by file list, size and SHA-256 hash, then open a text diff of changed files.Glob Pattern TesterTest glob patterns like **/*.js, {a,b} and !exclusions against a list of file paths.JMESPath TesterEvaluate JMESPath expressions against JSON live, the query language used by the AWS CLI.MongoDB Query TesterTest MongoDB find filters, projections and aggregation pipelines on sample JSON documents.Semantic Version CalculatorBump, compare, sort and test SemVer versions against npm ^, ~ and x ranges.XSLT TesterRun an XSLT 1.0 stylesheet on XML in your browser and see the output as HTML, XML or text.ASCII Diagram EditorDraw boxes, arrows and text on a character grid and copy plain-text diagrams for code and READMEs.DBF File ViewerOpen dBase .dbf files and shapefile tables, search and sort records, export CSV or XLSX.MBOX File ViewerOpen .mbox mail archives: list and search messages, read them, save attachments, export EML.MDB File ViewerOpen Access .mdb and .accdb databases in your browser: list tables, view rows, export CSV.Shapefile ViewerView zipped shapefiles on a map with the attribute table, then export to GeoJSON or CSV.
See all 53 Code Playgrounds & Testers →