Zero Signup ToolsFree browser tools

Developer Tools

Prettier Config Generator

Build a .prettierrc, prettier.config.mjs, or package.json prettier block in your browser. All Prettier 3 options, presets, plugins, live preview.

Quick presets

Apply a known config. You can tweak any option afterwards.

Core formatting

Line length Prettier targets before wrapping.

Spaces per indent level.

false

Indent with tabs instead of spaces.

true

End every statement with a semicolon.

false

Use single quotes outside JSX.

false

Use single quotes inside JSX attributes.

Trailing commas in arrays, objects, and calls.

Parens around a single arrow function param.

Objects, brackets, and quote properties

true

Spaces inside object literals: { foo } vs {foo}.

false

Closing > of multi-line elements at end of last line.

When to quote object keys.

Honour author line breaks in object literals (Prettier 3.5).

Files, line endings, and embedded code

Line endings used when saving formatted files.

Format code inside template literals (html, css, gql).

false

One HTML and JSX attribute per line.

false

Prettier 3.1 nested-ternary layout.

HTML, Markdown, and Vue

Whitespace handling in HTML files.

Markdown prose wrapping.

false

Indent <script> and <style> in .vue files.

Plugins

Toggling a plugin adds it to the plugins array and includes it in the install command below. Each plugin is its own npm package.

Per-file overrides

Output style

Generated file

Drop into .prettierrc at the root of your project.

{
}

Live preview

Sample code rendered with your indent, quote, semicolon, and trailing-comma choices.

import { createUser, deleteUser } from "./users";

const config = {
  name: "Zero Signup Tools",
  retries: 3,
  tags: ["fast", "free", "offline",],
};

async function main() {
  const user = await createUser({
    email: "hi@example.com",
    role: "admin",
  },);

  return user;
};

main();

The preview shows visible options only. Prettier itself applies every option (object wrapping, line wrapping, JSX, HTML, and more) when it formats a real file.

Summary

Non-default options

0

Plugins enabled

0

Overrides

0

Indent style

2 spaces

Quotes

double

Print width

80 cols

Every option matches a Prettier default. Either pick a preset, tweak an option, or enable Include defaults in output to write a file with explicit values.

Option reference

Every option above is documented here with its Prettier default and the current value in your config.

OptionDefaultCurrentDescription
printWidth8080Line length Prettier tries to wrap at. The default is 80.
tabWidth22Number of spaces per indentation level. The default is 2.
useTabsfalsefalseIndent with tabs instead of spaces. The default is false.
semitruetrueAdd a semicolon at the end of every statement. The default is true.
singleQuotefalsefalseUse single quotes instead of double quotes. The default is false.
quotePropsas-neededas-neededWhen to quote object properties. as-needed, consistent, or preserve.
jsxSingleQuotefalsefalseUse single quotes in JSX. The default is false (double quotes).
trailingCommaallallTrailing commas where valid. all (Prettier 3 default), es5, or none.
bracketSpacingtruetrueSpaces between brackets in object literals. The default is true.
bracketSameLinefalsefalsePut > of a multi-line element at the end of the last line. Default false.
arrowParensalwaysalwaysAlways include parens around a single arrow function param. Default always.
objectWrappreservepreserveHow to wrap object literals: preserve keeps user breaks, collapse merges.
endOfLinelflfLine ending used when saving. lf is recommended for all platforms.
embeddedLanguageFormattingautoautoFormat code in template literals (auto) or leave alone (off).
singleAttributePerLinefalsefalseOne HTML / JSX attribute per line. The default is false.
proseWrappreservepreserveHow to wrap prose in markdown: preserve, always, or never.
htmlWhitespaceSensitivitycsscssWhitespace sensitivity for HTML files. css respects display values.
vueIndentScriptAndStylefalsefalseIndent <script> and <style> in .vue files. The default is false.
experimentalTernariesfalsefalseUse Prettier 3.1's experimental nested-ternary formatting.

How to use

  1. Pick a preset (Prettier defaults, Standard, Airbnb, Tailwind, React + Vite, Next.js, legacy Prettier 2, or hard tabs) or start from defaults and tune each option.
  2. Edit the Core formatting group to set printWidth, tabWidth, useTabs, semi, singleQuote, jsxSingleQuote, trailingComma, and arrowParens.
  3. Enable any plugins you use (Tailwind class sorter, sort imports, organize imports, package.json field order, Prisma, Svelte, Astro). The plugins array and install command update automatically.
  4. Optionally turn on per-file overrides for Markdown, YAML, or JSON to apply different rules to those files.
  5. Pick the output format that matches your project (.prettierrc, .prettierrc.json, .prettierrc.json5, prettier.config.mjs, prettier.config.cjs, package.json key, .prettierignore, or VS Code settings) and click Copy file or Download.
  6. Run the matching install command at the bottom (npm, pnpm, yarn, or bun) to install Prettier and the plugins you enabled.

About this tool

Prettier Config Generator builds a Prettier 3 configuration file from a short set of preset choices and explicit toggles for every documented option. Outputs are available in eight ready-to-paste formats: .prettierrc (JSON), .prettierrc.json (JSON), .prettierrc.json5 (JSONC with inline option descriptions so the file is self-documenting), prettier.config.mjs (ESM with a typed @type {import("prettier").Config} JSDoc comment), prettier.config.cjs (CommonJS), a package.json "prettier" key block, a .prettierignore starter that covers the directories Prettier should skip on every standard JS / TS / Next / Astro / SvelteKit project, and a .vscode/settings.json snippet that wires up format-on-save with the Prettier extension. Only non-default options are written so the file stays minimal and self-documenting, which is what the Prettier docs recommend; an Include defaults switch flips the file to a fully explicit form when needed. Every Prettier 3 option is covered: printWidth, tabWidth, useTabs, semi, singleQuote, jsxSingleQuote, quoteProps, trailingComma, bracketSpacing, bracketSameLine, arrowParens, endOfLine, embeddedLanguageFormatting, singleAttributePerLine, proseWrap, htmlWhitespaceSensitivity, vueIndentScriptAndStyle, experimentalTernaries, and the 3.5 objectWrap option. Quick presets seed common configs: Prettier defaults, JavaScript Standard style (single quote, no semi, no trailing comma), Airbnb-flavored (single quote, semi, all trailing commas, 100 columns), Tailwind project (defaults plus prettier-plugin-tailwindcss), React + Vite, Next.js, the legacy Prettier 2 trailingComma es5 style, and a hard-tabs setup. Plugin toggles add prettier-plugin-tailwindcss (the most popular class sorter), @ianvs/prettier-plugin-sort-imports, prettier-plugin-organize-imports, prettier-plugin-packagejson, prettier-plugin-prisma, prettier-plugin-svelte, and prettier-plugin-astro to the plugins array and update the install command at the bottom. Per-file overrides for *.md, *.{yml,yaml}, and *.json are one click each. A live preview panel renders a short JS sample with your indent style, quote style, semicolons, and trailing-comma rules applied, so you can see the impact of the four most visible options before you paste the file into your project. The reference table at the bottom lists every option with its documented default, your current value, and a one-line description so it doubles as a quick Prettier docs lookup. Install commands cover npm, pnpm, yarn, and bun and include any plugins you enabled. Everything runs locally in your browser; the options you pick, the plugins you enable, and the files you download never leave the page.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools