JSON Formatter
JSON Formatter for developers — instant, offline-style and privacy-safe.
Convert HTML to JSX in your browser — fixing the common React gotchas like class and inline styles. A fast regex first pass, not a full converter.
Your browser is preparing the tool. It runs 100% locally.
Paste HTML and the tool rewrites the differences React needs: class becomes className, for becomes htmlFor, HTML comments become JSX comments, and an inline style string becomes a camelCased style object. It is a fast first pass for moving markup into a component. It is regex-based, so it does not self-close void elements or rename every attribute — review the result. It runs entirely in your browser; nothing is uploaded.
This tool takes a block of HTML and applies the most common transformations needed to use it as JSX in a React component. It handles the renames and rewrites that would otherwise cause errors or warnings when you paste raw HTML into JSX.
It is the quick way to start converting a markup snippet — a template, an icon, a chunk of a page — into a component, doing the repetitive find-and-replace for you so you can focus on the parts that need judgement.
The tool runs a set of regular expressions over your HTML. It renames the class attribute to className and for to htmlFor, turns HTML comments into JSX comment expressions, and converts an inline style string into a JavaScript object with camelCased property names, which is what JSX expects.
Because it works by pattern-matching rather than parsing the markup into a tree, it is fast and dependency-free. It also means it only changes the specific things its patterns target, and it cannot reason about the structure the way a full converter would.
class= → className= for= → htmlFor=
HTML comment → JSX comment in braces
inline style string → camelCased style object<div class="box" style="margin-top: 10px"><!-- hi --></div> → <div className="box" style={{marginTop: '10px'}}>{/* hi */}</div>It fixes the common gotchas, but it is a regex pass: it does not self-close void elements (a br stays unclosed, which is invalid JSX) and renames only class and for, not the dozens of other camelCase attributes. Review the result.
Your HTML never leaves your device. The conversion runs in your browser with no network request, so nothing is uploaded.
Because the work is local, you can convert proprietary templates or internal markup without it being stored or sent anywhere.
Nothing persists between sessions — close the tab and the input and output are gone.
For the common cases it targets — class, for, comments and inline styles — the conversion is reliable and saves the repetitive edits that catch people out when pasting HTML into JSX.
It does not self-close void elements. Tags like br, img and input are valid in HTML without a closing slash, but JSX requires them self-closed. The tool leaves them as they are, so you must add the slash yourself or JSX will not compile.
It renames only class and for. JSX has dozens of other attribute differences — onclick to onClick, tabindex to tabIndex, and the many SVG attributes like stroke-width to strokeWidth — which this regex pass does not handle. Convert those by hand.
The style conversion is pattern-based, so an inline style whose value contains a colon (such as a url) or unusual syntax can be converted incorrectly. Check any complex inline styles in the output, and treat the result as a first pass to review.
Convert a markup snippet into JSX to drop into a React component.
Rename class and for and rewrite inline styles automatically.
Make a first pass over HTML templates moving to React.
See how HTML attributes map to their JSX equivalents.
For a thorough conversion, use a parser-based HTML-to-JSX tool or your editor's converter, then compile to catch what remains. This regex pass handles the common gotchas; finish the void elements and other attribute renames by hand.
Rewrites the common HTML-to-JSX differences (class, for, comments, inline style) with regex; honest that it does not self-close void elements or rename every attribute, so review the output.
JSON Formatter for developers — instant, offline-style and privacy-safe.
JSON Validator for developers — instant, offline-style and privacy-safe.
Base64 Encoder for developers — instant, offline-style and privacy-safe.
Fast, free Hash Generator that runs entirely client-side in your browser.
Fast, free UUID Generator that runs entirely client-side in your browser.
Fast, free CSS Minifier that runs entirely client-side in your browser.
It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.