Format TypeScript with Prettier's TS parser. Preserves type annotations, generics, decorators, interfaces, and mapped types. Full TypeScript 5.x. 100% browser-based.
The TypeScript Formatter is a Prettier-powered, browser-based tool that instantly beautifies TypeScript code while preserving all type information. Using Prettier's TypeScript parser, it handles the full TypeScript 5.x language — type annotations, generics, interfaces, enums, decorators, mapped types, conditional types, template literal types, and `satisfies`. Configurable indentation and an 80-column print width produce output that matches the style of leading TypeScript projects. All processing happens in a Web Worker; your code never leaves the browser.
QWhich TypeScript version does this support?
TypeScript 5.x — including satisfies, const type parameters, decorator metadata, and all earlier TypeScript features.
QDoes it remove or modify my type annotations?
No. Prettier's TypeScript parser is type-annotation-aware and preserves all annotations, generics, interfaces, and enums exactly as written. Only whitespace and formatting are changed.
QIs my code sent to a server?
No. All formatting runs locally in a Web Worker. Your TypeScript code never leaves the browser.
QWhat is the difference between this and the TypeScript Minifier?
The formatter makes code human-readable with proper indentation. The TypeScript Minifier compiles TS to JavaScript and then applies Terser to produce the smallest possible output for production deployment.