HTML to JSX

Convert an HTML fragment to JSX — class to className, inline styles to objects, comments to JSX comments.

Converted in this browser. Nothing is sent anywhere.

class→className, for→htmlFor, style strings become objects, comments become JSX comments, void elements self-close, event attributes camelCase. The result is a JSX fragment — wrap it in your component.

How to use

  1. Paste HTML.
  2. Convert.
  3. Copy the JSX output.

What it supports

Handles attribute renames (class, for, tabindex, http-equiv…), style strings to objects, void elements, and HTML comments. Event attributes like onclick are flagged — JSX wants onClick handlers. Input up to 500,000 characters; a converter, not a sanitizer.

Related tools

Related guides