Skip to content
M2TOOLKIT

HTML to JSX Converter

Paste HTML from a template, CodePen or design tool and get JSX you can drop into a React component.

  • Free
  • No sign-up
  • Runs in your browser
class → className, for → htmlFor, inline styles → objects, SVG attributes camelCased

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to use the HTML to JSX Converter

  1. Paste your HTML.
  2. Optionally wrap it in a component.
  3. 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.

Other tools people use alongside the html to jsx converter.