Luhn Validator
Check any number against the Luhn checksum and see the working.
Convert HTML into valid JSX, with every attribute renamed correctly.
The HTML to JSX converter handles every difference between the two: reserved-word attributes, camelCased names, self-closing void elements, style strings becoming objects, and braces in text needing escapes.
JSX looks like HTML and differs in a dozen small ways, every one of which is a build error. This converts a fragment properly: class becomes className, for becomes htmlFor, every hyphenated attribute becomes camelCase, and void elements get their self-closing slash.
Inline styles are the conversion people get wrong most often. A style attribute is a string in HTML and an object in JSX, with camelCase property names and quoted values, so style="font-size: 12px" has to become style={{ fontSize: "12px" }}. Comments become JSX expression comments, braces in text content are escaped because they are syntax, and the whole thing can be wrapped in a component function ready to paste into a file.
class, for, tabindex, colspan, the SVG presentation attributes — around fifty names that differ, each mapped rather than guessed.
style="font-size: 12px" becomes style={{ fontSize: "12px" }}, which is the conversion people most often do by hand and get wrong.
A literal brace in text is JSX syntax, so it is escaped rather than becoming a build error.
HTML comments become JSX expression comments, which is the only form JSX accepts.
An onclick string cannot become a function automatically, so it is reported rather than silently producing broken code.
A fragment, a component's markup, or a whole page.
The output is wrapped in a function with that name, ready to export.
Inline event handlers cannot be converted automatically and are flagged.
Paste it straight into a .jsx or .tsx file.
Because class is a reserved word in JavaScript. The same applies to for, which becomes htmlFor. React chose the DOM property names rather than the HTML attribute names.
From a string into an object with camelCase keys and quoted values: style="font-size: 12px" becomes style={{ fontSize: "12px" }}. The double braces are an object inside an expression, not special syntax.
The attribute is renamed to onClick, but the value stays a string — and React needs a function. Those are flagged as warnings, because only you know what the handler should call.
Because braces are JSX syntax for an expression. A literal brace in text has to be written as {"{"} or it becomes a syntax error.
What people who use the HTML to JSX think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the HTML to JSX. It takes half a minute and no account.
Write the first reviewCheck any number against the Luhn checksum and see the working.
Draw a grid layout and get the CSS, including named template areas.
Strong random passwords and passphrases, generated locally.
Convert a duration between seconds, ISO 8601, clock time and words.
Convert between JSON arrays and NDJSON, one compact document per line.
Check XML is well-formed and find the exact tag that breaks it.
Explore a JSON document as a collapsible tree with paths you can copy.
Test a regular expression live, with every match and capture group shown.