GraphToTeX
Graph export guide

Desmos to TikZ: export graphs to LaTeX

If you have a graph in Desmos and need TikZ code for a paper, problem set, or Overleaf project, you can recreate the equations in GraphToTeX and export an editable LaTeX figure.

GraphToTeX is a free, Desmos-style graphing calculator with direct TikZ export. It supports functions, implicit equations, and 3D surfaces, with a compiled LaTeX preview before you download.

Open the TikZ graphing calculator

Enter the equations manually using the syntax below. GraphToTeX does not import Desmos share links or saved projects.

How to turn your equations into TikZ

  1. Enter each equation in the 2D graphing calculator. Try x^2, sin(x), or x^2+y^2=1. Use sqrt(x) for a square root and (x+1)/(x-1) for a fraction. Add another expression for each curve.
  2. Match the graph you want. Pan and zoom the canvas, set exact viewport bounds in Graph settings, and adjust each curve's color, thickness, domain, and line style.
  3. Choose Export TikZ. Check the compiled LaTeX preview and set the export scale. Choose “Complete LaTeX document with required packages” if you want a file you can compile on its own.
  4. Copy the code or download the .tex file. Paste a figure snippet into your existing document, or open the complete document in Overleaf or your local LaTeX editor.

Using the exported graph in Overleaf

For a 2D figure snippet, add the required packages to your document's preamble:

\usepackage{tikz}
\usetikzlibrary{arrows.meta}

Paste the exported code between \begin{document} and \end{document}. The export includes the visible graph bounds, curve styles, and your grid and axis settings. You can edit the TikZ source afterwards.

Exporting 3D graphs and commutative diagrams

Use the 3D graphing calculator with PGFPlots export for surfaces such as sin(x)*cos(y). Rotate the view, adjust the axis bounds, and choose Export TikZ 3D. Load \usepackage{pgfplots} and \pgfplotsset{compat=1.18} in your LaTeX preamble. The export preview shows PGFPlots' orthographic projection.

For objects and arrows, use the commutative diagram editor. It exports both coordinate-based TikZ and native TikZ-CD, with LaTeX labels and editable arrow styles.

Common questions

Can I paste a Desmos link to convert a graph automatically?

No. Re-enter your equations in GraphToTeX and adjust the view. Use plain expression syntax such as sin(x) and x^2, rather than LaTeX commands copied from a formula editor.

Does the export create an image or editable LaTeX code?

The download is a .tex file containing TikZ or PGFPlots code. Compile it in your LaTeX document to produce the figure. The preview in the export dialog typesets the generated figure so you can check it first.

Can I export implicit equations and trigonometric functions?

Yes. The 2D calculator supports implicit equations such as x^2+y^2=1. Implicit curves use sampled contours, and trigonometric functions use sampled coordinates to preserve radian behavior. Adjust Samples in the expression settings if a curve needs more detail.