Convert HTML into React JSX. Paste markup and get JSX with class turned into className, for into htmlFor, inline style strings into style objects, void tags self-closed, comments wrapped in braces and event handlers converted — plus notes on anything you should check, like form fields that became uncontrolled. Optionally wrap the result in a component. It's free, runs in your browser, and nothing is uploaded.
| HTML | JSX |
|---|---|
| class | className |
| for | htmlFor |
| tabindex | tabIndex |
| style="color: red" | style={{ color: "red" }} |
| <br> | <br /> |
| <!-- note --> | {/* note */} |
| onclick | onClick |
Attribute names (className, htmlFor, tabIndex), style strings to objects, self-closing void tags, comments in braces, and one root element per component.
style="margin-top: 4px" becomes style={{ marginTop: "4px" }}, with vendor prefixes and custom properties handled.
In React, value without onChange makes a read-only field. defaultValue keeps it editable; switch back if you want a controlled input.
They become arrow functions, but check them: React passes its own event object and the code may rely on this.
No. It's parsed and converted in your browser, and scripts in it are never run.
The HTML is parsed by the browser's own HTML parser inside a template element, which handles everything real-world markup throws at it — unclosed paragraphs, unquoted attributes, void elements like br and img — exactly as a browser would, and never runs scripts or loads images. The resulting tree is written out as JSX. Attributes are renamed to React's names: class to className, for to htmlFor, tabindex to tabIndex and about seventy others, while data- and aria- attributes stay as they are. Boolean attributes become bare props. Inline style strings become style objects with camelCased properties, vendor prefixes in React's form (WebkitLineClamp), custom properties quoted and unitless numbers left as numbers. On form fields, value and checked become defaultValue and defaultChecked so the fields stay editable. Inline event handlers become arrow functions, comments become {/* */}, braces and angle brackets in text are escaped, and several top-level elements are wrapped in a fragment. Anything that needs a human decision is listed as a note.