Prettier Playground
Preview Prettier-style formatting and copy the matching .prettierrc.
Input
1 line · 23 charsResult
6 lines · 30 charsPrettier Playground shows how each Prettier option changes your formatted output and generates the exact config that reproduces the result. Paste code, pick a parser, toggle options such as semi, singleQuote, printWidth, trailingComma and arrowParens, then copy the matching .prettierrc in JSON or YAML. The option-to-config mapping is deterministic, so the snippet you copy is the config you just tuned. Note: the formatter is a lightweight in-browser preview that applies the most visible options (semi, singleQuote, trailingComma, arrowParens, JSON re-indent) — it is not the official Prettier engine and does not re-flow line wrapping. Run the copied config through real Prettier for final formatting. Everything runs locally; code is never uploaded.
Approximate preview — it applies the toggled options but is not the official Prettier engine and does not re-flow line wrapping. Run the copied config through real Prettier for final formatting.
Examples
const f = (x) => xconst f = x => xarrowParens: avoid removes parentheses around a lone arrow parameter.
const a = "x"const a = 'x'singleQuote: true switches double quotes to single quotes.
{ "semi": false, "singleQuote": true }semi: false
singleQuote: trueYAML config output mirrors the JSON options exactly.
About this tool
Prettier Playground is a focused companion to the official Prettier playground: in addition to live formatting it emits the exact configuration that produced the result. Toggle an option, see the diff in the output, and copy the config your team needs.
The option panel covers the core knobs — print width, indentation, semicolons, quotes, trailing commas, bracket spacing, arrow parens, prose wrap, end of line, and single attribute per line. Only options that differ from Prettier defaults are emitted, keeping the copied config short.
Parser selection is explicit so you can format JavaScript, TypeScript, CSS, HTML, Markdown, JSON, YAML or GraphQL. The emitted .prettierrc includes the matching parser where needed.
What this tool does not do
- The live formatter implements the core Prettier options; it is not a byte-for-byte replacement for the full standalone build with plugins.
- Custom Prettier plugins and legacy version pinning are not supported.
- The .editorconfig hint covers indentation and line endings only, not formatting rules Prettier has no EditorConfig equivalent for.
How to use this tool
Paste code
Paste a snippet into the input panel or load one of the example chips. The parser selector controls how it is interpreted.
Tune options
Change semicolons, quotes, print width, trailing commas and the other switches. The formatted output and config update immediately.
Compare formats
Switch the config tab between JSON and YAML to see the same options in your preferred .prettierrc format.
Copy
Copy the formatted output or the generated config. Only non-default options are included in the config.
Use cases
Set team standards
Try option combinations on real components before committing a .prettierrc that the whole team will use.
Debug formatting
Isolate which option causes a surprising line break or quote change without editing your project config.
Migrate config formats
Convert a set of options between .prettierrc JSON and YAML with the same values.
Option mapping
| Option | Values |
|---|---|
| printWidth | number |
| semi | true | false |
| singleQuote | true | false |
| trailingComma | none | es5 | all |
| arrowParens | always | avoid |
| endOfLine | lf | crlf | cr | auto |
Options equal to Prettier defaults are omitted from the generated config so it stays minimal.
Common mistakes
Mistake:Expecting the config to include every option.
Fix:Only non-default options are emitted. That is intentional: a minimal .prettierrc is easier to maintain and Prettier fills in the rest.
Mistake:Using the wrong parser for a snippet.
Fix:Select the matching parser; TypeScript syntax under the babel parser can format differently or fail.
Mistake:Treating this as a minifier.
Fix:Prettier formats for readability and keeps comments; it does not shrink code. Use a minifier for production bundles.
Frequently asked questions
Is this real Prettier?
The option set and output semantics follow Prettier and the downloaded standalone build does the formatting in your browser. This page focuses on the option-to-config workflow: you tune options and receive the matching .prettierrc, with no project setup required.
Which parsers are supported?
JavaScript, TypeScript, JSX, CSS, HTML, Markdown, JSON, YAML and GraphQL are available through the parser selector. Pick the one that matches your snippet; auto-detection is only a hint and can be overridden.
How big is the download?
Prettier standalone is loaded lazily when you first format, and parser plugins are fetched on demand rather than all at once. The core is small; the larger TypeScript and Babel parsers are only downloaded if you select them.
Can I use plugins?
No. Custom Prettier plugins are not supported in this browser tool, so plugin-dependent syntax will not format as it would in a project that installs those plugins.
Where does my code go?
Nowhere. Formatting and config generation happen entirely in your browser tab; no snippet is uploaded or stored on a server.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.