Prettier options

width 80 / 2 spaces / semicolons / double quotes / trailing es5 / bracket spaces / arrows always

Input

Output

Formatted output will appear here.

TypeScript Formatter

Paste or import TypeScript above and click Prettify to reformat it with consistent indentation and spacing — free, in your browser, with nothing uploaded to a server. Powered by Prettier.

TypeScript-aware formatting

The TypeScript parser handles types, interfaces, generics, enums, and imports while using the same configurable Prettier options as JavaScript.

No type checking

The formatter does not load tsconfig.json or project dependencies, so it cannot catch type errors.

Other formatters

Need to convert Markdown instead? Try the free Markdown to Word/HTML/PDF converter.

Need to run some numbers? Try the free online calculators.

Frequently asked questions

How do I format TypeScript online?+

Paste your .ts code, adjust Prettier options if needed, then click Prettify. Types, interfaces, generics, and imports are formatted locally in your browser.

Does it check types?+

No — it only reformats syntax. It doesn't type-check against a project's types.

Is my code sent to a server?+

No. Formatting runs entirely in your browser.

More formatters

JSON formatter · JavaScript formatter · CSS formatter · YAML formatter · C formatter · C++ formatter · VBScript formatter

We use cookies to show ads via Google AdSense. See our Privacy Policy for details.