Skip to content
ToolUlkaa Tool
All tools

Mathematics

Percentage CalculatorFraction CalculatorEquation SolverTensorMatrix CalculatorUnit ConverterNumber Base ConverterDerivative CalculatorIntegral CalculatorLimit CalculatorAlgebra CalculatorQuadratic Formula CalculatorFactoring CalculatorLogarithm CalculatorSquare Root CalculatorLong Division CalculatorSignificant Figures CalculatorLCM and GCF CalculatorPrime Factorization CalculatorTriangle CalculatorPythagorean Theorem CalculatorSlope CalculatorArea CalculatorVolume CalculatorScientific CalculatorGraphing Calculator

Categories

AcademicTextMathematicsStatisticsMachine LearningAIData ScienceFile
All tools
Mathematics

Einsum Calculator

Evaluate einsum expressions on one to three tensors and check your own.

Operation
Letters name axes. A letter missing from the output is summed. 1 to 3 operands.
Rik=∑jAijBjkR_{ik} = \sum_{j} A_{ij} B_{jk}Rik​=j∑​Aij​Bjk​
Try:

Use nested brackets, like [[1, 2], [3, 4]], and the shape is worked out. Or give a flat list and a shape (one dimension may be -1).

Result

einsum("ij,jk->ik")

Rank
2
Shape
[2, 2]
Elements
4
in R2×2\text{in } \mathbb{R}^{2 \times 2}in R2×2
[22284964]\begin{bmatrix} 22 & 28 \\ 49 & 64 \end{bmatrix}[2249​2864​]
[[22, 28], [49, 64]]
  1. Tools
  2. Mathematics
  3. Tensor Calculator
  4. Einsum Calculator

About Einsum Calculator

This einsum calculator evaluates an Einstein summation expression on one to three tensors you enter and shows the result with its shape, so you can test an expression before using it in NumPy, PyTorch or TensorFlow. It is free, needs no sign-up and runs in your browser, so nothing you enter is uploaded.

In an expression such as ij,jk->ik, each letter names an axis. The letters before the arrow describe the inputs, one group per tensor, and the letters after the arrow describe the output. A letter that appears in the inputs but not in the output is summed over. Sizes must agree: if j is 3 in one tensor and 2 in the other, the page reports "Axis j has sizes 3 and 2".

You can leave off the arrow. The output then keeps the letters that appear exactly once, in alphabetical order, as NumPy does, so ij,jk gives the same matrix product. Only letters are accepted as axis names, there is no ellipsis, and the page takes one to three operands, so the trace ii-> (5 for [[1, 2], [3, 4]]), the diagonal ii->i and the transpose ij->ji all work. The page opens on the matrix product ij,jk->ik. For contracting two axes of rank 3 tensors at once, see the tensor contraction page.

How to use Einsum Calculator

  1. 1Pick a mode: Shape and reshape, Tensor product, Kronecker product, or Einsum.
  2. 2Enter tensor A as nested brackets like [[1, 2, 3], [4, 5, 6]], or as a flat list of numbers with a shape such as 2, 3 in the shape box. One shape entry may be -1.
  3. 3For the product and einsum modes, enter tensor B the same way.
  4. 4In Shape mode, type a target shape to reshape to (for example 3, -1) and optionally an axes order for transpose (for example 1, 0).
  5. 5In Einsum mode, write the expression, such as ij,jk->ik, or pick an example chip: matrix product, trace, diagonal, transpose or a three-matrix chain. One box appears for each operand, labelled with its axes.
  6. 6Read the rank, shape and element count above each result, and the values below as nested brackets.

Features

  • Shape inference from nested brackets, or a flat list plus a shape.
  • Reshape with one -1 dimension worked out automatically.
  • Transpose with reversed axes by default, or a custom axes order for any rank.
  • Tensor (outer) product whose shape is the shape of A followed by the shape of B.
  • Kronecker product with NumPy-style padding, so a vector and a matrix can be combined.
  • Einsum with one, two or three operands: the trace (ii->), the diagonal (ii->i), the transpose (ij->ji), the matrix product, a three-matrix chain (ij,jk,kl->il), batch products and more, with an implicit output when you leave off the arrow.
  • Each tensor box is labelled with the axes the expression gives it, and the expression is shown as a KaTeX formula.
  • Shapes and small results are typeset with KaTeX, for example the shape as R with a superscript of 2 by 3 and a matrix as a bracketed array.
  • A size guard: an einsum over 10 million multiply-adds is refused with the exact count, and one over 100,000 runs in a Web Worker so the page stays responsive.
  • Readable errors for ragged lists, non-numbers, mismatched sizes and bad axes.
  • Rank, shape and element count shown for every result, and values printed as nested brackets rounded to nine decimals.

Einstein summation

Multiply the entries that share a letter, then add over every letter missing from the output.

ij,jk->ik    C[i,k] = Σ_j A[i,j] B[j,k]
i,i->        s = Σ_i a[i] b[i]
ij,ij->ij    C[i,j] = A[i,j] B[i,j]

Worked examples

  • ij,jk->ik with A [[1, 2, 3], [4, 5, 6]] and B [[1, 2], [3, 4], [5, 6]] → gives [[22, 28], [49, 64]]

    The matrix product, summed over j.

  • i,i-> with [1, 2, 3] and [4, 5, 6] → gives 32 (rank 0)

    1×4 + 2×5 + 3×6, the dot product.

  • ij,j->i with A [[1, 2, 3], [4, 5, 6]] and B [1, 0, 2] → gives [7, 16]

  • ij,ij-> with the same matrix twice, [[1, 2, 3], [4, 5, 6]] → gives 91

    The sum of all squared entries.

  • ii-> with [[1, 2], [3, 4]] → gives 5 (rank 0)

    The trace. With ii->i the same matrix gives the diagonal [1, 4].

  • ij,jk,kl->il with A [[1, 2], [3, 4]], B the identity and C a matrix of ones → gives [[3, 3], [7, 7]]

    Three operands: A times B times C.

Common expressions the page can evaluate

ExpressionComputesOperand shapes
ij,jk->ikMatrix product[m, n] and [n, p]
i,i->Dot product[n] and [n]
ij,ij->ijElement-wise producttwo tensors of the same shape
ij,ij->Sum of element-wise productstwo tensors of the same shape
i,j->ijOuter product[m] and [n]
bij,bjk->bikBatch matrix product[b, m, n] and [b, n, p]

Good to know

Using this page

Open the Einsum tab, type your expression, and enter one tensor as nested brackets for each operand. The page takes one to three operands, so ii-> (a trace) and ij,jk,kl->il (a chain) both work. A calculation of more than 10 million multiply-adds is refused.

Privacy: how it works

  • All arithmetic is done by TypeScript code in your browser tab. There is no network request when you calculate, no library is downloaded to do it, and nothing is stored.

Tips

  • Use -1 in a reshape to let the calculator fill in one dimension. A 24-element tensor reshaped to 4, -1 becomes shape [4, 6].
  • If a reshape fails, multiply your target dimensions and compare with the element count shown for tensor A.
  • To check an einsum string, try tiny tensors with distinct values, then compare the rank and shape before the values.
  • A custom transpose order lists the old axes in their new positions. For shape [2, 3, 4], the order 1, 0, 2 gives shape [3, 2, 4].

Frequently asked questions

Is it really free?

Yes. There is no price, no trial and no credit card. Ulkaa Tool does the work with your own device, so there is no server bill to pass on to you.

Do I need an account?

No. There is no sign-up and no login. Open the page and use it. An Ulkaa account is not needed for anything on this tool.

Does it run in my browser?

Yes. Your values are processed by code running in your browser tab, on your own device.

Is my data uploaded?

No. Your values are never sent to Ulkaa or to anyone else. You can check this yourself by watching the Network tab in your browser developer tools while you use the tool.

What does einsum do?

It multiplies tensors and sums over chosen axes in one expression. The letters name axes, and any letter left out of the output is summed away.

How do I write a matrix product as einsum?

ij,jk->ik. The shared letter j is summed, leaving rows from the first matrix and columns from the second.

Why does the page say the number of operands does not match?

The page shows one tensor box per operand named before the arrow, from one to three, so the number of comma-separated groups decides how many boxes you fill in.

More Tensor Calculator pages

  • Tensor CalculatorCheck shapes, reshape and transpose, and compute tensor products, Kronecker products and einsum contractions.
  • Tensor Product CalculatorThe tensor product of two tensors, with the result shape worked out.
  • Tensor Shape CalculatorShape, rank and element count of a tensor, plus reshape and transpose.
  • Kronecker Product CalculatorThe Kronecker product of two matrices, with block layout.
  • Tensor Contraction CalculatorContract two tensors by summing over shared indices.

Ulkaa Apps

  • Ulkaa
  • Calendar
  • Task
  • Note
  • Disk
  • Call
  • Contact
  • Mail
  • Finance
  • Health
  • Office
  • Work
  • Workspace
  • Halum
  • Jaal
  • Islam
  • Game
  • Weather
  • Campus
  • News
  • Developer
  • Help
  • Account
About·Privacy·Terms·© 2026 Ulkaa

What is Ulkaa Tool?

Ulkaa Tool is a free collection of fast, privacy-friendly online tools from Ulkaa Network. Calculate your GPA and CGPA, edit rich text, count words and characters, replace text and more — all in your browser.

Every tool runs entirely in your browser — no sign-up, and your data never leaves your device.

Academic

  • GPA Calculator
  • CGPA Calculator
  • Citation Generator
  • Quiz Maker

Text

  • Rich Text Editor
  • Word Counter
  • Character Counter
  • Text Replacement

Ulkaa

  • Ulkaa
  • Ulkaa News
  • Ulkaa Campus
  • Ulkaa Tool
  • Ulkaa Game
  • Ulkaa Weather
  • Ulkaa Islam

Company

  • About Ulkaa
  • Careers
  • Support
  • Help
  • Privacy Policy
  • Terms of Service
  • Disclaimer
  • Sitemap

© 2015-26, Ulkaa. All rights reserved.
Facebook PageLinkedIn CompanyX (Twitter) ProfileInstagram ProfileGitHub Account