Format React JSX with Prettier's Babel parser. Handles hooks, class components, and HOCs. Configurable quotes, semicolons, and trailing commas. Browser-based.
The JSX Formatter is a Prettier-powered, browser-based tool that instantly beautifies React JSX files into clean, consistently formatted output. Using Prettier's Babel parser, it handles JSX expressions, JSX spread attributes, self-closing tags, multi-line JSX returns, React hooks, class components, higher-order components (HOCs), and all modern React patterns. Configurable indentation and an 80-column print width produce output matching the conventions of leading React projects. All formatting runs in a Web Worker; your code never leaves the browser.
QWhat React patterns does this support?
All standard React patterns — function components, class components, hooks, context providers, HOCs, forwardRef, memo, fragments, controlled and uncontrolled inputs, and JSX spread props.
QWhat is the difference between JSX Formatter and TSX Formatter?
The JSX Formatter uses Prettier's Babel parser for plain JavaScript JSX files (.jsx). The TSX Formatter uses Prettier's TypeScript parser for files that combine TypeScript types with JSX (.tsx).
QIs my code sent to a server?
No. All formatting runs locally in a Web Worker inside your browser. Nothing is transmitted to any server.