THE MATHTEXLAB TOOLBOX
LaTeX Fraction Generator
Build grouped fractions with separate numerator and denominator fields. Choose automatic, display or text style, preview and copy the mathematical source.
Loading the fraction builder…
Put the numerator and denominator in their own fields
For a fraction inside another fraction, follow the nested fraction field example. For a power on the whole quotient, check fraction parentheses and exponent scope.
A LaTeX fraction has two grouped arguments:
\frac{numerator}{denominator}. This builder supplies the outer
braces so an expression such as a+b stays together above the
line, and c+d stays together below it. It is a notation
builder, not a calculator or algebra simplifier.
- Enter one mathematical expression in each field. Use TeX commands for Greek letters, roots or nested fractions. Match any braces inside your expressions.
-
Choose automatic, display-size or text-size notation. The preview uses
display math: automatic
\fracnormally looks like\dfrachere.\tfracexplicitly requests the smaller form. Inline text in a destination document can give automatic fractions a different size. - Copy the generated code, or open it in the Equation Editor. That page asks before replacing your current equation and offers PNG, SVG and PDF exports using the existing tested workflow.
The fields accept up to 256 characters each and reject document environments, alignment separators, comments and unmatched braces. The shared renderer checks supported base/AMS commands. Keep document preambles and surrounding math delimiters out of the fields.
Three useful fraction patterns
A grouped rational expression: put x+1 in the
numerator and x-1 in the denominator.
\frac{x+1}{x-1}
A nested fraction: put \frac{1}{x} in the
numerator and y+1 in the denominator. Display style can improve
readability when both parts contain mathematical structure.
\dfrac{\frac{1}{x}}{y+1}
A derivative notation template: enter
\partial f and \partial x. This writes the
notation and does not differentiate a function.
\frac{\partial f}{\partial x}
For explanations of fraction styles, inline notation and grouping, read the LaTeX fraction guide. Find commands in the Symbols Library.
Saving, errors and mathematical limits
The builder saves one fraction locally when browser storage is available. Forget saved fraction removes that copy and pauses saving for the visit; the current expression stays visible. Undo covers the last 40 changes during this visit. No expression is uploaded or added to a URL. Opening the editor stages it in same-tab session storage for explicit review.
A denominator of zero is printable notation, but division by zero is
undefined in ordinary arithmetic. The builder does not validate domains,
solve equations or simplify expressions. It also cannot support arbitrary
LaTeX packages. In a full LaTeX document, load amsmath for
\dfrac and \tfrac, and place the generated
expression inside math mode.
Syntax references: Overleaf’s fraction documentation and the MathJax command index. Copy depends on your browser’s clipboard support; the generated source remains selectable.
LaTeX fraction questions
What is the difference between frac, dfrac and tfrac?
\frac follows the surrounding math style,
\dfrac forces display sizing, and
\tfrac forces text sizing. The generator preview uses
display math, so the first two usually look alike here. See the
fraction-style comparison
before choosing a form for inline text.
How do I put a fraction inside another fraction in LaTeX?
Enter an inner fraction such as \frac{1}{x} in either field
and an expression such as y+1 in the other. The builder
adds the outer argument groups; you must still balance braces inside
each field. Follow the
nested fraction walkthrough
to check the grouping. This builds notation and does not simplify the
result.