TypeScript-aware formatting
The TypeScript parser handles types, interfaces, generics, enums, and imports while using the same configurable Prettier options as JavaScript.
width 80 / 2 spaces / semicolons / double quotes / trailing es5 / bracket spaces / arrows always
Input
Output
Formatted output will appear here.
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.
The TypeScript parser handles types, interfaces, generics, enums, and imports while using the same configurable Prettier options as JavaScript.
The formatter does not load tsconfig.json or project dependencies, so it cannot catch type errors.
Need to convert Markdown instead? Try the free Markdown to Word/HTML/PDF converter.
Need to run some numbers? Try the free online calculators.
Paste your .ts code, adjust Prettier options if needed, then click Prettify. Types, interfaces, generics, and imports are formatted locally in your browser.
No — it only reformats syntax. It doesn't type-check against a project's types.
No. Formatting runs entirely in your browser.
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.