PickCode Add to Chrome
  1. Home
  2. Free tools
  3. HTML to JSX converter

HTML to JSX converter

Paste HTML and get JSX you can drop into a React component. Attributes are renamed, inline styles become objects and void tags close themselves.

Try an example
JSX

    

Copy from live websites instead

PickCode turns any element on any page into Tailwind, React, Blade or HTML + CSS in one click. 5 free elements a day.

Add to Chrome, free

What the converter does

React attribute names
class becomes className, for becomes htmlFor, and tabindex, colspan or srcset get their camelCase names.
Style objects
Inline style strings become objects with camelCase properties. CSS variables stay as quoted keys.
Valid tags
Void tags like <img> and <br> close themselves, comments become JSX comments and several top-level elements get a fragment.
SVG and forms
SVG attributes like stroke-width become strokeWidth. Form value and checked become defaultValue and defaultChecked.

Inline event handlers like onclick are removed, because React expects functions. Add your own handlers after pasting.

More free tools