Skip to content
Image-Ination
Start here
Image-Ination

HTML Math Equation Generator

Updated November 2026 · free, works in your browser

HTML Math Generator
How do I write this equation in HTML?
Try: sum_i=1^n, sqrt(2), pi/2, +-, <=, inf, x^2, a_i
Entity style
Tap a symbol to add its shorthand
HTML code
Preview
Symbols converted
Free, works in your browser, no sign-up.
How the shorthand is converted
  • A word such as int, sum, pi or inf becomes its character reference.
  • base_sub^sup becomes base<sub>sub</sub><sup>sup</sup>.
  • a/b becomes <sup>a</sup>&frasl;<sub>b</sub>; 1/2, 1/4 and 3/4 use &frac12;, &frac14; and &frac34;.
  • sqrt(x) becomes &radic; followed by x with an overline.
  • Decimal reference = Unicode code point N: &#N; Hex reference = N in base 16: &#xH;
Open full version →

To write a math symbol in HTML, use a character reference such as &int; for the integral sign or &sum; for a summation. This generator turns plain shorthand like int_0^1 x^2 dx = 1/3 into ready-to-paste HTML with entities, subscripts, superscripts, fractions and roots, and shows a live preview next to the code.

How to use

  1. Type your expression in the shorthand field. Separate the parts of the expression with spaces.
  2. Use words for symbols (int, sum, pi, inf, sqrt), underscore for a subscript, caret for a superscript and a slash for a fraction.
  3. Or tap any symbol in the palette to add its shorthand to the end of the field.
  4. Choose the entity style: named (&int;), decimal (&#8747;) or hex (&#x222B;).
  5. Check the preview, then copy the code and paste it into your page, or copy a link to the result to share it.

How it is calculated

Every math symbol is a Unicode character with its own code point. HTML lets you write that character by number, so the converter uses two simple rules: the decimal reference is &#N; where N is the code point, and the hex reference is &#xH; where H is the same number written in base 16. For example, the integral sign has code point 8747, which is 222B in hex. Named references such as &int; are taken from the list of named character references in the HTML Living Standard, and the code points come from the Unicode Standard. Symbols without a standard name are written as decimal references.

The structure rules are:

  • base_sub^sup becomes base, then a subscript element, then a superscript element.
  • a/b becomes a superscript numerator, the fraction slash (&frasl;) and a subscript denominator. The fractions 1/2, 1/4 and 3/4 use their single-character entities.
  • sqrt(x) becomes the root sign (&radic;) followed by x with an overline.
SymbolShorthandNamedDecimalHex
∫int&int;&#8747;&#x222B;
∑sum&sum;&#8721;&#x2211;
√sqrt&radic;&#8730;&#x221A;
∞inf&infin;&#8734;&#x221E;
πpi&pi;&#960;&#x3C0;
±+-&plusmn;&#177;&#xB1;
≠!=&ne;&#8800;&#x2260;
≤<=&le;&#8804;&#x2264;

Frequently asked questions

How do I write an integral sign in HTML?

Use &int;, &#8747; or &#x222B;. All three display the same character. For limits, add subscript and superscript elements after it, which is what the shorthand int_0^1 produces.

How do I write a fraction in HTML code?

For simple fractions, put the numerator in a superscript, add &frasl; and put the denominator in a subscript. Halves, quarters and three quarters also have single-character entities. For stacked, multi-level fractions, MathML or a dedicated math rendering library is a better fit.

Do the named, decimal and hex forms look different?

No. They are three ways of writing the same character, and browsers render them identically. Named references are easier to read, while numeric references work for every character.

Will every symbol show up on every device?

Common symbols are present in most system fonts. Rarer ones may fall back to another font, so check the preview and test the page on a phone as well as a desktop.

Is this a replacement for MathML?

No. Entities and sub/sup elements are good for short inline expressions in articles and notes. Long or deeply nested formulas are better written in MathML.

Technical writing and study often continue on trips, and it helps to plan the trip around it. A quiet room with a proper desk, reliable internet and good lighting makes a long drafting session easier. Checking hotels by destination for these basics before you book saves time once you arrive.

Other tools

  • Sail Performance CalculatorCalculate displacement/length ratio, sail area/displacement ratio, capsize screening value and hull speed from a boat's dimensions.
  • Nautical Unit ConverterConvert knots, mph, km/h and m/s, or nautical miles, miles, kilometres, metres and feet, instantly.
  • Passage Time CalculatorEnter distance and average speed to get passage duration and arrival time for any boat leg.

All tools →