TypeScript Formatter
Format TypeScript and TSX with Prettier, including interfaces, generics, enums and decorators.
Runs in your browserTypeScript → TypeScript
Loading tool…
Example
interface User{id:number;name?:string}
const u:User={id:1}interface User {
id: number;
name?: string;
}
const u: User = { id: 1 };How to use the TypeScript Formatter
- Paste or type your TypeScript into the input area, or open a file from your device.
- Adjust the options above the editor if the tool offers any.
- Review the TypeScript result, then copy it or download it as a file.
Privacy and limitations
- Your data is processed on your device and is not uploaded to any server.
Related converters
JavaScript BeautifierFormat and beautify JavaScript (including JSX and modern syntax) with Prettier: indentation, quotes and semicolons.JSON to TypeScript InterfaceGenerate TypeScript interfaces from sample JSON, with optional properties inferred from arrays.CSS BeautifierBeautify minified or messy CSS into readable, consistently indented rules with one declaration per line.SCSS FormatterFormat SCSS/Sass stylesheets with Prettier, handling nesting, variables, mixins and maps.Less FormatterFormat Less stylesheets with Prettier, keeping variables, mixins and nested rules readable.HTML BeautifierBeautify HTML with Prettier: consistent indentation plus formatting of embedded CSS and JavaScript.Markdown FormatterNormalise Markdown with Prettier: consistent list markers, headings, emphasis and table alignment.GraphQL FormatterFormat GraphQL queries, mutations, fragments and schema definitions (SDL) with Prettier.