How to use the HTML to JSX Converter
- Paste your HTML.
- Optionally wrap it in a component.
- Copy or download the JSX.
What does this tool do?
React needs a few changes from plain HTML: class becomes className, for becomes htmlFor, style strings become objects, void elements like <input> must self-close and curly braces in text must be escaped. Inline SVG attributes such as stroke-width become strokeWidth. Event handler attributes are turned into placeholder functions to fill in.
Everything runs in your browser — nothing you paste is uploaded.
Why use it?
- Handles SVG and comments.
- Escapes { } in text.
- Optional component wrapper.
Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Last reviewed by the M2Toolkit team.