TypeScript Formatter
Format TypeScript and TSX code with Prettier using your preferred indentation and style options.
What is the TypeScript Formatter?
TypeScript adds types to JavaScript. Formatting keeps interfaces, generics and type annotations readable.
How does it work?
The TypeScript parser builds a syntax tree that Prettier prints consistently. The parser is loaded on demand.
Example
interface Loan{amount:number} becomes a properly indented interface.
Frequently asked questions
Is my data sent to a server?
No. This tool runs entirely in your browser; nothing you paste is uploaded or stored.
Does it type-check my code?
No. It only formats; use the TypeScript compiler for type errors.
Related tools
Enable JavaScript to use this calculator.