SafeToolkits

HTML to JSX

Convert HTML markup to React JSX.

Runs in your browser: what you paste is never uploaded

class → className, for → htmlFor, inline styles → objects, void tags self-closed, several top-level elements wrapped in a fragment.

How to use HTML to JSX

  1. 1Paste or type your inputUse the box above, or click Sample to try it with an example.
  2. 2Choose your optionsPaste HTML; the JSX updates as you type. Several top-level elements are wrapped in a fragment.
  3. 3Copy the resultCopy it with one click. Nothing is sent anywhere.

About HTML to JSX

Convert HTML to valid React JSX: class becomes className, inline styles become objects and void tags self-close.

Frequently asked questions

What about SVG attributes like stroke-width?

They're converted to their React names, such as strokeWidth.

Are HTML comments kept?

Yes. They become JSX comments, written as {/* … */}.

Is what I paste sent anywhere?

No. The tool runs entirely in your browser and never sends what you type or paste to a server.

Is it free?

Yes. It's free, with no sign-up and no limits.

Related tools