When Wolfram Language expressions are displayed in notebooks, they are represented by two-dimensional typesetting structures of boxes. Boxes normally work invisibly behind the scenes, but you can find out what box structure corresponds to a given expression.

Using Menus...

You can see the underlying box structure of any expression in a notebook by selecting its cell bracket and choosing Cell Show Expression ():

  • Input and output cells are typically represented by box structures, indicated by BoxData. Text and section header cells are typically represented by text strings or text structures, indicated by TextData.

Programmatically...

Use MakeBoxes to get the box structure that represents an expression:

The box arguments are strings and other boxes:

  • An expressions box representation is not necessarily unique.
  • MakeBoxes does not evaluate its argument. Use ToBoxes if you want the argument to evaluate before it is converted to boxes.

You can see the underlying box structure of any expression in a notebook by hovering over its cell bracket and choosing Advanced Show Cell Expression... from the cell menu:

Programmatically...

Use MakeBoxes to get the box structure that represents an expression:

The box arguments are strings and other boxes:

  • An expressions box representation is not necessarily unique.
  • MakeBoxes does not evaluate its argument. Use ToBoxes if you want the argument to evaluate before it is converted to boxes.

Notes

Get the displayed form of a box expression with RawBoxes:
An expressions box representation depends on the display format. StandardForm gives the standard Wolfram Language representation, with capitalized function names and square function brackets:
TraditionalForm gives the traditional textbook format, with lowercase function names and round function brackets: