LaTeX Fraction Generator

Generate \frac / nested fractions from numerators and denominators.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter a/b, or a numerator and denominator, and choose \frac, \dfrac or \nicefrac to get the LaTeX code.

How to use

1
Step 1
Type a slash fraction such as 3/4, or fill numerator and denominator.
2
Step 2
Choose the style.
3
Step 3
Press Generate and copy.

How it works

\frac scales with the surrounding style, \dfrac forces display size inside inline math, and \nicefrac gives a slanted inline fraction and needs the nicefrac or units package. Expressions with operators, such as x+1, go inside the braces unchanged.

\frac{a}{b}   \dfrac{a}{b}   \nicefrac{a}{b}

Worked example

Three quarters

Input
3/4
Output
\frac{3}{4}
Walkthrough
dfrac gives \dfrac{3}{4}, nicefrac gives \nicefrac{3}{4}. Numerator x+1 and denominator y gives \frac{x+1}{y}.

Limitations

  • Text conversion only; no preview.
  • Needs amsmath for \dfrac and nicefrac for \nicefrac.

Questions

When should I use \dfrac?
To force a full-size fraction in inline text, at the cost of taller lines.
Does nicefrac need a package?
Yes, nicefrac or xfrac.
Can I use expressions?
Yes, they go straight into the braces.

Features

  • Three fraction styles
  • Slash shortcut
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • PDF, What is it FOR?

    Computerphile

    Papers and appendices often ship as fixed PDF packets.

    Watch on YouTube
  • Learn JSON - Full Crash Course

    freeCodeCamp.org

    Structured citation data often serializes as JSON/CSL.

    Watch on YouTube