Everything on the site.

Big-O notationAlgorithms · Count the steps in real loops, then compare n, n log n, n² and 2ⁿ on a live chart.RecursionAlgorithms · Watch frames push and pop on the call stack for factorial and Fibonacci.BFS vs DFSAlgorithms · A queue against a stack: draw a graph and see which order each search visits it in.Sorting algorithmsAlgorithms · Seven sorts on the same input, with comparison, swap and write counts side by side.Binary searchAlgorithms · Halve the range, probe the middle, repeat: with lo, mid and hi drawn on the array.Sets, relations and functionsDiscrete maths · Shade any set expression on a Venn diagram and test a relation for its properties.Proof by inductionDiscrete maths · Four worked proofs revealed one step at a time, and a broken one to diagnose.CombinatoricsDiscrete maths · An exact nPr and nCr calculator, and a Pascal’s triangle that shows its own addition rule.Boolean algebraDiscrete maths · The laws, De Morgan, and normal forms, with a truth-table generator built in.Finite-state machinesTheory · Build a DFA in a table, see it drawn, and run strings through it one symbol at a time.Domain theoryTheory · Why recursion needs least fixed points, and how CPOs, Scott continuity and powerdomains supply them.Truth table generatorTools · Expression in, truth table out: with DNF, CNF, a minimal form and LaTeX.Graph traversal visualiserTools · Draw a graph, then animate BFS, DFS and Dijkstra with the frontier shown.Recursion tree visualiserTools · Paste a recursive function or a recurrence and see its call tree and call count.Gradient descentML maths · Drag the starting point, set the learning rate, and watch it converge or blow up.Vectors and embeddingsML maths · Bend the plane with a 2×2 matrix and measure how close toy word vectors are.Softmax and cross-entropyML maths · Edit the logits and watch the probabilities, the loss and the gradient update live.Attention mechanismML maths · Q, K and V for three tokens, a live score heatmap, and the weighted sum of values.Formatting a CS paper in LaTeXLaTeX · Page limits, \documentclass, front matter, theorem environments and the bibliography.Camera-ready checklistLaTeX · Fonts embedded, PDF/A, copyright form, source bundle, and why final versions get rejected.LaTeX templatesLaTeX · Where the official classes live, plus a minimal article template you can copy.Boolean algebra calculatorTools · A Boolean expression simplifier that names the law used at every step.K-map solverTools · Fill in a Karnaugh map and see the groups, the minimal SOP and POS, and the essential terms.Logic gate simulatorTools · Wire up gates, flip the switches, and get the truth table and expression of your circuit.Regex to NFA converterTools · Type a regular expression and watch Thompson’s construction build its NFA, fragment by fragment.NFA to DFA converterTools · Enter an NFA or a regex and step through the subset construction, then minimise the DFA.DFA simulatorTools · Edit a DFA, run strings through it step by step, batch-test them and share the machine as a link.Regular expressions to automataTheory · Regex to NFA to DFA to minimal DFA, worked through on one example with every set shown.The halting problemTheory · Why no program can tell whether every program halts, with the paradox program played out.Pigeonhole principleDiscrete maths · n pigeons, k holes: why some hole gets ⌈n/k⌉, and the surprising things that follows from it.Dijkstra’s algorithmAlgorithms · Shortest paths with a priority queue: a worked table, a proof, and a graph you can redraw.Hash functionsAlgorithms · Keys in, buckets out: hash a word four ways, then watch chaining and probing handle collisions.Sorting algorithm visualizerTools · Up to seven sorts race on the same data, then step through any one of them line by line.LaTeX table generatorTools · Type or paste a table, merge cells, pick booktabs, and copy clean tabular code.Combination calculatorTools · Exact nCr with the cancelling shown, combinations with repetition, and a full list for small n.Permutation calculatorTools · nPr, nʳ, anagrams like MISSISSIPPI and round-table seatings, with exact working.AlgorithmsSection · Step-through visualisations of sorting, searching, recursion, graph traversal, Dijkstra’s algorithm, hash functions and Big-O growth, with pseudocode that follows along.Discrete mathsSection · Sets, relations and functions, proof by induction, counting, the pigeonhole principle and Boolean algebra, explained with worked examples and interactive checkers.TheorySection · Finite-state machines, regular expressions and automata, the halting problem, and the mathematical semantics of programming languages, explained from first principles.ML mathsSection · Gradient descent, vectors and embeddings, softmax and cross-entropy, and attention, each with a formula, a worked numeric example and a live version.ToolsSection · Free browser tools: truth tables, Boolean simplification, K-maps, logic gates, nCr and nPr, regex to NFA to DFA, sorting and graph visualisers, and LaTeX tables.LaTeXSection · How to format a CS conference or workshop paper in LaTeX, a camera-ready checklist, and a minimal template you can adapt.
Free tool

LaTeX table generator: tabular code from a grid or spreadsheet

Build a LaTeX table in a spreadsheet-style grid, or paste one from Excel, Google Sheets or a CSV file, and copy clean tabular code with the right packages. Merged cells, booktabs rules, column alignment, captions and full-width tables are all handled. Everything runs in your browser.

Interactive: Grid editor with live LaTeX output and previewUpdated

LaTeX table generator

Type into the grid, or paste cells straight from Excel, Google Sheets or a CSV file. The LaTeX updates as you type.

Selected: A1. Shift-click another cell to select a range to merge. Enter moves down a row.

Import from a spreadsheet or CSV

Copy a range of cells in Excel, Numbers or Google Sheets and paste it here (it arrives tab-separated), or paste comma-separated text. Quoted CSV fields such as "Smith, J." are kept together. You can also paste a copied range directly into any grid cell.

Rules and header
Float and width

LaTeX code

Preamble

    Preview

    An approximation in the browser: LaTeX spacing and fonts differ slightly, and cell text is shown as typed.

    How to use the generator

    1. Fill the grid. Type into the cells, use Enter to move down (it adds a row at the bottom), or paste a block copied from a spreadsheet into any cell: it spreads across the grid and adds rows and columns as needed. For a whole file, open “Import from a spreadsheet or CSV”.
    2. Set each column’s alignment with the menu above it: left, centre or right, a wrapping paragraph column of fixed width, a stretching column for full-width tables, or a decimal-aligned number column.
    3. Merge cells by clicking one cell and Shift-clicking another, then pressing “Merge cells”. A range within one row becomes \multicolumn; a range spanning rows uses \multirow as well. Click inside a merged cell and press “Split cell” to undo it.
    4. Set the header rows: usually one, or two when a merged heading groups columns underneath it.
    5. Pick a rule style, caption and label, then copy the code into your document and the \usepackage lines into the preamble, before \begin{document}.

    By default every cell is escaped, so a percentage sign or an underscore in your data cannot break the document. Untick “Escape special characters” when your cells contain LaTeX on purpose, such as $\alpha$ or \textit{n}.

    What the example table produces

    The grid opens with a small comparison of sorting algorithms. With the default settings the generator writes:

    \begin{table}[htbp]
      \centering
      \caption{Running times of three sorting algorithms.}
      \label{tab:sorting}
      \begin{tabular}{lccc}
        \toprule
        \textbf{Algorithm} & \textbf{Best} & \textbf{Worst} & \textbf{Stable} \\ \midrule
        Insertion sort & O(n) & O(n\textasciicircum{}2) & Yes \\
        Merge sort & O(n log n) & O(n log n) & Yes \\
        Quicksort & O(n log n) & O(n\textasciicircum{}2) & No \\
        \bottomrule
      \end{tabular}
    \end{table}

    and needs only \usepackage{booktabs} in the preamble. Notice that O(n^2) became O(n\textasciicircum{}2): the caret is special in LaTeX. To typeset it as mathematics, untick escaping and write $O(n^2)$ in the cell instead.

    LaTeX table basics

    A LaTeX table has two layers. The tabular environment draws the grid itself. The table environment around it is a float: a box LaTeX may move to the top or bottom of a page, or to a page of its own, so that it never splits awkwardly. The caption and the label for cross-references belong to the float.

    • The column specification, the argument after \begin{tabular}, has one letter per column: l, c or r for left, centred or right, and p{3cm} for a column of fixed width whose text wraps. A | between letters draws a vertical rule.
    • & separates cells and \\ ends a row. Each row must have exactly as many cells as the specification has columns, counting a \multicolumn{n} as n.
    • Horizontal rules come from \hline, from \cline{2-3} for a rule under some columns only, or from the booktabs commands below.
    • Captions go above tables. That is the usual convention for tables (figures put theirs below), and most publisher classes expect it. The \label must come after \caption, or \ref will print the section number instead of the table number.

    The float position, such as [htbp], lists the places LaTeX may put the table: here, top, bottom, or a separate float page. Giving it all four is the most reliable choice. A lone [h] is often silently changed to [ht], and if the table does not fit it drifts to the end of the chapter. When a table truly must stay at that point in the text, the float package’s [H] forces it, at the cost of possible gaps at the bottom of the page.

    Why booktabs looks better

    The booktabs package replaces \hline with three rules of different weights: a heavier \toprule and \bottomrule and a lighter \midrule under the header, with a little extra space around each. Its documentation argues for a short list of habits that make tables easier to read, and they hold up well:

    • Never use vertical rules.
    • Never use double rules.
    • Put units in the column heading, not in every cell.
    • Use \cmidrule(lr){2-3} to group columns under a shared heading, rather than drawing a box around them.

    Most journal and conference classes typeset tables in this style, which is why the generator defaults to it. Choose “Full grid” only when a venue or a teacher asks for boxed cells.

    Merged cells: multicolumn and multirow

    \multicolumn{2}{c}{Accuracy} makes one cell span two columns, with its own alignment. Spanning rows needs the multirow package: \multirow{2}{*}{Method} is written in the top row, and the rows below leave that cell empty. Here is a two-level header from the generator (set “Header rows” to 2), with “Method” and “Time” spanning both header rows:

    \begin{table}[htbp]
      \centering
      \caption{Results with a two-level header.}
      \label{tab:results}
      \begin{tabular}{lccr}
        \toprule
        \multirow{2}{*}{\textbf{Method}} & \multicolumn{2}{c}{\textbf{Accuracy}} & \multirow{2}{*}{\textbf{Time (s)}} \\ \cmidrule(lr){2-3}
         & \textbf{Train} & \textbf{Test} &  \\ \midrule
        Baseline & 0.91 & 0.88 & 12 \\
        Ours & 0.95 & 0.93 & 15 \\
        \bottomrule
      \end{tabular}
    \end{table}

    With a two-row header and booktabs, the generator underlines the “Accuracy” group with \cmidrule(lr){2-3}, the booktabs way to show that two columns belong together, and puts \midrule under the second header row. In the full-grid style the generator already writes \cline for rows that a multirow cell continues through, because a full \hline would cut through it.

    Tables that are too wide

    LaTeX reports an Overfull \hbox warning when a table is wider than the text. You have three good options, all in the generator’s “Width” menu or column menus:

    1. Let long text wrap. Change the widest text column to p{4cm}. This is usually the best fix because the font size stays the same.
    2. Use full width with tabularx. \begin{tabularx}{\linewidth}{X c c} makes the table exactly as wide as the text, and every X column shares the leftover space and wraps its text. The generator turns the first text column into X if you have not chosen one.
    3. Scale the whole table with \resizebox{\linewidth}{!}{…} from graphicx. It is quick, but it shrinks the font too, so use it only for tables slightly too wide. Many venues do not allow scaled-down table text.

    For a table that is wider than the page however you set it, rotate it with the sidewaystable environment from the rotating package, or split it into two tables.

    Lining up decimal points

    Right-aligning numbers only lines up their decimal points when they all have the same number of decimal places. The siunitx package’s S column aligns on the decimal marker whatever the precision. Choose “decimal S” for a column and the generator wraps non-numeric cells, such as the heading, in braces so siunitx does not try to read them as numbers:

    \begin{table}[htbp]
      \centering
      \caption{Decimal points lined up with siunitx.}
      \label{tab:mass}
      \begin{tabular}{lS}
        \toprule
        \textbf{Sample} & {\textbf{Mass (g)}} \\ \midrule
        A & 1.5 \\
        B & 12.25 \\
        C & 103.125 \\
        \bottomrule
      \end{tabular}
    \end{table}

    For finer control, give the column a format, for example S[table-format=3.3] for up to three digits before and three after the point. Add that by hand after copying.

    Common errors and how to fix them

    Error messageWhat it usually means
    Misplaced alignment tab character &An & appears outside a tabular, usually in text such as “R&D”. Write it as \&; the generator does this when escaping is on.
    Extra alignment tab has been changed to \crA row has more cells than the column specification allows. Count the &s, remembering that \multicolumn{n} counts as n columns.
    Missing $ insertedAn unescaped _ or ^ in text. Escape it, or put the expression in $…$.
    Undefined control sequence \toprulebooktabs is not loaded. Copy the preamble lines as well as the table.
    Illegal pream-tokenAn unknown column letter, such as X outside tabularx or S without siunitx.
    \ref prints the wrong number\label comes before \caption. Swap them.
    Private by design The grid, the generated code and anything you paste stay in this browser tab. Nothing is uploaded, and there is nothing to sign up for.

    More LaTeX help

    For the document around your table, the LaTeX templates guide has a minimal article preamble that already loads booktabs and graphicx, and how to format a CS paper covers figures, tables and captions in the context of a full submission. If your table is a truth table, the truth table generator writes its own LaTeX directly. The booktabs, multirow, tabularx and siunitx manuals on CTAN are the definitive references.