Skip to content
Devtoolry

TypeScript Formatter

Format TypeScript and TSX code with Prettier, including types, generics and decorators.

About the TypeScript Formatter

The TypeScript Formatter formats .ts and .tsx code with Prettier, including type annotations, generics, enums and decorators.

Everything runs in your browser, so your input is never uploaded to a server.

How to use the TypeScript Formatter

  1. Paste TypeScript or TSX, or open a file.
  2. Choose indentation, quotes and semicolons.
  3. Copy or download the formatted code.

Frequently asked questions

Does formatting type-check my code?

No. Formatting only needs valid syntax. Use the TypeScript Compiler tool to see type errors.

Is TSX supported?

Yes, JSX inside TypeScript files is formatted too.