How to use
- Paste text, open a UTF-8 file, or try the Sample.
- Choose the input and settings, then run the tool or enable Auto run.
- Review the result, then copy or download it. Changing the input invalidates the previous result.
JavaScript Formatter
Format JavaScript, JSX, TypeScript and TSX without running the code.
Processing runs in your browser. Your input is not sent to DevToolsy.
How it works
Prettier parses and prints your source with consistent spacing and indentation. Select JavaScript / JSX or TypeScript / TSX to match the input; syntax errors include a source position.
const users=[{name:"Ada",active:true},{name:"Lin",active:false}];function activeNames(items){return items.filter(user=>user.active).map(user=>user.name)}const users = [
{ name: "Ada", active: true },
{ name: "Lin", active: false },
];
function activeNames(items) {
return items.filter((user) => user.active).map((user) => user.name);
}
Format JavaScript, JSX, TypeScript and TSX without running the code.
Options and data fidelity
Set indentation, line width, quote preference and semicolons. This is a formatter, not a compiler, linter or minifier. It does not execute code or resolve imports.
Working with the result
Successful formatting means the parser accepted the syntax. Use your project compiler, linter and tests to check types, imports and runtime behavior.
Review the result, then copy or download it. Changing the input invalidates the previous result.
UTF-8 input up to 1 MiB per document, output up to 8 MiB. JSONPath and Schema: 5-second timeout; other tools: 30 seconds.
Frequently asked questions
Which JavaScript and TypeScript inputs work?
Prettier parses and prints your source with consistent spacing and indentation. Select JavaScript / JSX or TypeScript / TSX to match the input; syntax errors include a source position.
Can I choose quotes and semicolons?
Set indentation, line width, quote preference and semicolons. This is a formatter, not a compiler, linter or minifier. It does not execute code or resolve imports.
Does formatting check types or fix logic?
No. Successful formatting means the parser accepted the syntax. Use your project compiler, linter and tests to check types, imports and runtime behavior.
Is my input uploaded?
Processing runs in your browser. Your input is not sent to DevToolsy.
Can I open a local file?
UTF-8 input up to 1 MiB · output up to 8 MiB