---
title: "ExpressionTree"
language: "en"
type: "Symbol"
summary: "ExpressionTree[expr] gives a Tree object from the structure of the expression expr. ExpressionTree[expr, struct] gives a Tree object from the expression expr with data and subtrees as specified by struct."
keywords: 
- expression
- tree
- expression tree
- tree of expression
- subexpression tree
- array tree
- association tree
- CSG region tree
- data tree
- graph tree
- JSON tree
- list tree
- notebook tree
- rules tree
- text tree
- XML tree
canonical_url: "https://reference.wolfram.com/language/ref/ExpressionTree.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Tree Construction & Representation"
    link: "https://reference.wolfram.com/language/guide/TreeConstructionAndRepresentation.en.md"
  - 
    title: "Computation on Trees"
    link: "https://reference.wolfram.com/language/guide/ComputationOnTrees.en.md"
  - 
    title: "Trees"
    link: "https://reference.wolfram.com/language/guide/Trees.en.md"
related_functions: 
  - 
    title: "Tree"
    link: "https://reference.wolfram.com/language/ref/Tree.en.md"
  - 
    title: "NestTree"
    link: "https://reference.wolfram.com/language/ref/NestTree.en.md"
  - 
    title: "TreeExpression"
    link: "https://reference.wolfram.com/language/ref/TreeExpression.en.md"
  - 
    title: "TreeForm"
    link: "https://reference.wolfram.com/language/ref/TreeForm.en.md"
  - 
    title: "ExpressionGraph"
    link: "https://reference.wolfram.com/language/ref/ExpressionGraph.en.md"
---
[EXPERIMENTAL]

# ExpressionTree

ExpressionTree[expr] gives a Tree object from the structure of the expression expr.

ExpressionTree[expr, struct] gives a Tree object from the expression expr with data and subtrees as specified by struct.

## Details and Options

* ``ExpressionTree`` can construct ``Tree`` objects from lists, arrays, rules, XML and arbitrary expressions as specified.

* Possible forms for ``struct`` for arbitrary expressions include: »

|                  |                                                                           |
| ---------------- | ------------------------------------------------------------------------- |
| "HeadTrees"      | trees corresponding to heads of subexpressions of the expression by level |
| "Heads"          | heads of subexpressions of the expression by level                        |
| "Subexpressions" | subexpressions of the expression by level                                 |
| "Atoms"          | atomic subexpressions of the expression at level -1                       |
| Null             | subexpressions of the expression by level with no data                    |
| None             | the expression itself                                                     |

* ``ExpressionTree`` takes the same options as ``Tree``.

* Additional options of ``ExpressionTree`` include:

[`Heads`](https://reference.wolfram.com/language/ref/Heads.en.md) 	include heads of expressions and their parts as subtrees

* Possible structures for the expression ``f[a, b][g[1, 2], x]`` with the default option setting ``Heads -> False`` include:

[image]

* Versions of these structures with the option setting ``Heads -> True`` include: »

[image]

* Held forms for ``struct`` for arbitrary expressions include:

|                      |                                                                                |
| -------------------- | ------------------------------------------------------------------------------ |
| "HeldHeadTrees"      | trees corresponding to held heads of subexpressions of the expression by level |
| "HeldHeads"          | held heads of subexpressions of the expression by level                        |
| "HeldSubexpressions" | held subexpressions of the expression by level                                 |
| "HeldAtoms"          | held atomic subexpressions of the expression at level -1                       |

* Possible forms for ``struct`` for common types of expressions include:

"XML"	tags, attributes and elements of an XML object

* Possible forms for ``struct`` for nested lists and associations include: »

|               |                                 |
| ------------- | ------------------------------- |
| "List"        | elements of nested lists        |
| "Association" | elements of nested associations |
| "Dataset"     | headers and data of a dataset   |

* Possible forms for ``struct`` for nested rules include: »

|              |                                                        |
| ------------ | ------------------------------------------------------ |
| "Rules"      | left-hand sides and leaves of nested rules             |
| "JSON"       | names and values of a JSON object, using names as data |
| "RawJSON"    | names and values of a JSON object, using names as keys |
| "FileSystem" | directories and files in a file system                 |

---

## Examples (45)

### Basic Examples (4)

Construct a tree from the structure of an expression:

```wl
In[1]:= ExpressionTree[f[a, b, c[p, q, r]]]

Out[1]= [image]
```

Include heads:

```wl
In[2]:= ExpressionTree[f[a, b, c[p, q, r]], Heads -> True]

Out[2]= [image]
```

Specify the structure to use:

```wl
In[3]:= ExpressionTree[f[a, b, c[p, q, r]], "Subexpressions", Heads -> True]

Out[3]= [image]
```

---

Construct a tree from symbolic XML:

```wl
In[1]:= ExpressionTree[XMLElement["tag", {"attr" -> "value"}, {"data", XMLElement["tag2", {}, {"data2"}]}], "XML"]

Out[1]= [image]
```

---

Construct a tree from an unevaluated expression:

```wl
In[1]:= ExpressionTree[Unevaluated[1 + 1], "HeldHeads"]

Out[1]= [image]
```

---

Construct a tree from nested associations:

```wl
In[1]:= ExpressionTree[<|a -> <|x -> 1, y -> 2|>, b -> <|x -> 3, y -> 4|>|>, "Association"]

Out[1]= [image]
```

### Scope (14)

#### Arbitrary Expressions (6)

##### "HeadTrees" (1)

---

If ``AtomQ[head]`` gives ``True``, then ``ExpressionTree[head[arg1, arg2, …], "HeadTrees"]`` gives a tree with root containing ``head`` and with children given by the ``ExpressionTree[argi, "HeadTrees"]`` :

```wl
In[1]:= ExpressionTree[f[g[1, 2], x], "HeadTrees"]

Out[1]= [image]
```

If ``AtomQ[head]`` gives ``False``, then ``ExpressionTree[head[arg1, arg2, …], "HeadTrees"]`` gives a tree with root containing ``ExpressionTree[head, "HeadTrees"]`` rather than ``head`` :

```wl
In[2]:= ExpressionTree[f[a, b][g[1, 2], x], "HeadTrees"]

Out[2]= [image]
```

Include heads:

```wl
In[3]:= ExpressionTree[f[a, b][g[1, 2], x], "HeadTrees", Heads -> True]

Out[3]= [image]
```

``ExpressionTree[atom, "HeadTrees"]`` gives a leaf containing the atomic expression ``atom`` :

```wl
In[4]:= ExpressionTree[1, "HeadTrees"]

Out[4]= [image]
```

##### "Heads" (1)

``ExpressionTree[head[arg1, arg2, …], "Heads"]`` gives a tree with root containing ``head`` and with children given by the ``ExpressionTree[argi, "Heads"]`` :

```wl
In[1]:= ExpressionTree[f[a, b][g[1, 2], x], "Heads"]

Out[1]= [image]
```

Include heads:

```wl
In[2]:= ExpressionTree[f[a, b][g[1, 2], x], "Heads", Heads -> True]

Out[2]= [image]
```

``ExpressionTree[atom, "Heads"]`` gives a leaf containing the atomic expression ``atom`` :

```wl
In[3]:= ExpressionTree[1, "Heads"]

Out[3]= [image]
```

##### "Subexpressions" (1)

``ExpressionTree[expr0[expr1, expr2, …], "Subexpressions"]`` gives a tree with root containing ``expr0[expr1, expr2, …]`` and with children given by the ``ExpressionTree[expri, "Subexpressions"]`` :

```wl
In[1]:= ExpressionTree[f[a, b][g[1, 2], x], "Subexpressions"]

Out[1]= [image]
```

Include heads:

```wl
In[2]:= ExpressionTree[f[a, b][g[1, 2], x], "Subexpressions", Heads -> True]

Out[2]= [image]
```

``ExpressionTree[atom, "Subexpressions"]`` gives a leaf containing the atomic expression ``atom`` :

```wl
In[3]:= ExpressionTree[1, "Subexpressions"]

Out[3]= [image]
```

##### "Atoms" (1)

---

``ExpressionTree[expr0[expr1, expr2, …], "Atoms"]`` gives a tree with children given by the ``ExpressionTree[expri, "Atoms"]`` :

```wl
In[1]:= ExpressionTree[f[a, b][g[1, 2], x], "Atoms"]

Out[1]= [image]
```

Include heads:

```wl
In[2]:= ExpressionTree[f[a, b][g[1, 2], x], "Atoms", Heads -> True]

Out[2]= [image]
```

``ExpressionTree[atom, "Atoms"]`` gives a leaf containing the atomic expression ``atom`` :

```wl
In[3]:= ExpressionTree[1, "Atoms"]

Out[3]= [image]
```

##### Null (1)

---

``ExpressionTree[expr0[expr1, expr2, …], Null]`` gives a tree with children given by the ``ExpressionTree[expri, Null]`` :

```wl
In[1]:= ExpressionTree[f[a, b][g[1, 2], x], Null]

Out[1]= [image]
```

Include heads:

```wl
In[2]:= ExpressionTree[f[a, b][g[1, 2], x], Null, Heads -> True]

Out[2]= [image]
```

``ExpressionTree[atom, Null]`` gives a leaf containing ``Null`` for an atomic expression ``atom`` :

```wl
In[3]:= ExpressionTree[1, Null]

Out[3]= [image]
```

##### None (1)

---

``ExpressionTree[expr, None]`` gives a leaf containing ``expr`` :

```wl
In[1]:= ExpressionTree[f[a, b][g[1, 2], x], None]

Out[1]= [image]
```

#### Common Expressions (1)

##### "XML" (1)

---

Construct a tree from symbolic XML:

```wl
In[1]:= ExpressionTree[XMLElement["tag", {"attr" -> "value"}, {"data", XMLElement["tag2", {}, {"data2"}]}], "XML"]

Out[1]= [image]
```

#### Nested Lists and Associations (3)

##### "List" (1)

---

Construct a tree from nested lists:

```wl
In[1]:= ExpressionTree[{1, {2, {{3, 4}, 5}}}, "List"]

Out[1]= [image]
```

##### "Association" (1)

---

Construct a tree from nested associations:

```wl
In[1]:= ExpressionTree[<|a -> 1, b -> <|c -> 2, d -> <|e -> <|f -> 3, g -> 4|>, h -> 5|>|>|>, "Association"]

Out[1]= [image]
```

##### "Dataset" (1)

---

Construct a tree from nested lists and associations:

```wl
In[1]:=
ExpressionTree[{
	<|"a" -> 1, "b" -> "x", "c" -> {1}|>, 
	<|"a" -> 2, "b" -> "y", "c" -> {2, 3}|>, 
	<|"a" -> 3, "b" -> "z", "c" -> {3}|>, 
	<|"a" -> 4, "b" -> "x", "c" -> {4, 5}|>, 
	<|"a" -> 5, "b" -> "y", "c" -> {5, 6, 7}|>, 
	<|"a" -> 6, "b" -> "z", "c" -> {}|>}, "Dataset"]

Out[1]= [image]
```

#### Nested Rules (4)

##### "Rules" (1)

---

Construct a tree from nested rules:

```wl
In[1]:= ExpressionTree[a -> {b -> {c, d}, e, f}, "Rules"]

Out[1]= [image]
```

##### "JSON" (1)

---

Construct a tree from JSON rules:

```wl
In[1]:= ExpressionTree[{"Hydrogen" -> {"AtomicNumber" -> 1, "AtomicWeight" -> 1.00793}, "Helium" -> {"AtomicNumber" -> 4.00259, "AtomicWeight" -> 2}, "Lithium" -> {"AtomicNumber" -> 3, "AtomicWeight" -> 6.94141}}, "JSON"]

Out[1]= [image]
```

##### "RawJSON" (1)

---

Construct a tree from JSON associations:

```wl
In[1]:= ExpressionTree[<|"Hydrogen" -> <|"AtomicNumber" -> 1, "AtomicWeight" -> 1.00793|>, "Helium" -> <|"AtomicNumber" -> 4.00259, "AtomicWeight" -> 2|>, "Lithium" -> <|"AtomicNumber" -> 3, "AtomicWeight" -> 6.94141|>|>, "RawJSON"]

Out[1]= [image]
```

##### "FileSystem" (1)

---

Construct a tree from a nested association with file names as keys:

```wl
In[1]:= ExpressionTree[FileSystemMap[FileByteCount, $InstallationDirectory, 2], "FileSystem"]

Out[1]= [image]
```

### Options (11)

#### Heads (2)

With the default option setting ``Heads -> False``, heads of expressions are not included as part of any level:

```wl
In[1]:= ExpressionTree[f[a, b][g[1, 2], x], Heads -> False]

Out[1]= [image]
```

With ``Heads -> True``, heads are included just like other elements of expressions:

```wl
In[2]:= ExpressionTree[f[a, b][g[1, 2], x], Heads -> True]

Out[2]= [image]
```

---

Structures for arbitrary expressions do not include heads by default:

```wl
In[1]:= ExpressionTree[f[a, b][g[1, 2], x], "Subexpressions", Heads -> False]

Out[1]= [image]
```

Include heads:

```wl
In[2]:= ExpressionTree[f[a, b][g[1, 2], x], "Subexpressions", Heads -> True]

Out[2]= [image]
```

#### Styling Individual Tree Elements (2)

Specify the label for the generated tree element:

```wl
In[1]:= ExpressionTree[a[b, c], TreeElementLabel -> "?"]

Out[1]= [image]
```

---

Specify labels and styles for subtrees by position:

```wl
In[1]:=
ExpressionTree[1[2[5, 6, 7], 3[8, 9, 10], 4[11, 12, 13]], 
	TreeElementLabel -> {___, _ ? EvenQ} -> None, TreeElementStyle -> {___, _ ? OddQ} -> {LightRed, EdgeForm[{Red, Dashed}]}]

Out[1]= [image]
```

#### Styling Entire Tree (4)

Specify labels and styles for all subtrees:

```wl
In[1]:= ExpressionTree[6[5[4[3, 2], 3[2, 1]], 4[3[2, 1], 2[1, 0]]], TreeElementLabel -> All -> None, TreeElementStyle -> All -> EdgeForm[Red]]

Out[1]= [image]
```

---

Specify the base style:

```wl
In[1]:= ExpressionTree[6[5[4[3, 2], 3[2, 1]], 4[3[2, 1], 2[1, 0]]], BaseStyle -> LightRed]

Out[1]= [image]
```

---

Specify the style for both the edges and the edges of the tree elements:

```wl
In[1]:= ExpressionTree[6[5[4[3, 2], 3[2, 1]], 4[3[2, 1], 2[1, 0]]], BaseStyle -> {Dashed, EdgeForm[{Dashing[{}], Thick}]}]

Out[1]= [image]
```

---

Specify the base style and styles for individual tree elements:

```wl
In[1]:= ExpressionTree[6[5[4[3, 2], 3[2, 1]], 4[3[2, 1], 2[1, 0]]], BaseStyle -> {Red, EdgeForm[None]}, TreeElementStyle -> All -> Opacity[0]]

Out[1]= [image]
```

#### Tree Layout and Graphics Options (3)

Specify the orientation for the root:

```wl
In[1]:= ExpressionTree[1[2[4, 5], 3[6, 7]], TreeLayout -> Bottom]

Out[1]= [image]
```

---

Specify a named embedding:

```wl
In[1]:= ExpressionTree[$CellContext`a[...], TreeLayout -> "BalloonEmbedding", IconizedObject[«labels»]]

Out[1]= [image]
```

---

Specify ``Graphics`` options:

```wl
In[1]:= ExpressionTree[a[b, c], Background -> LightBlue, ImageSize -> 50]

Out[1]= [image]
```

### Applications (1)

Construct a tree from the structure of a complicated antiderivative:

```wl
In[1]:= ExpressionTree[Integrate[1 / (x ^ 6 - 1), x]]

Out[1]= [image]
```

### Properties & Relations (15)

Construct a tree from an expression:

```wl
In[1]:= ExpressionTree[f[a, b, g[c, d], e]]

Out[1]= [image]
```

Get back the original expression:

```wl
In[2]:= TreeExpression[%]

Out[2]= f[a, b, g[c, d], e]
```

---

Transform a tree into an expression:

```wl
In[1]:= TreeExpression[[image]]

Out[1]= f[g[x, y], h]
```

Transform the resulting expression back into a tree:

```wl
In[2]:= ExpressionTree[%]

Out[2]= [image]
```

---

Construct trees from groupings of a list:

```wl
In[1]:= ExpressionTree[Groupings[{1, 2, 3, 4}, f -> 2]]

Out[1]= [image]
```

---

With the default structure ``"HeadTrees"``, ``ExpressionTree`` constructs a tree with subtrees containing data giving the tree structure of the heads of subexpressions:

```wl
In[1]:= ExpressionTree[f[g[1, 2], h][x, y[1, 2, 3]], "HeadTrees"]

Out[1]= [image]
```

---

The structure ``"Heads"`` gives a tree representing the same data as ``"HeadTrees"``, but with subtrees containing the heads of subexpressions themselves:

```wl
In[1]:= ExpressionTree[f[g[1, 2], h][x, y[1, 2, 3]], "Heads"]

Out[1]= [image]
```

``ExpressionTree[expr, "Heads"]`` gives output similar to ``TreeForm[expr]`` :

```wl
In[2]:= TreeForm[f[g[1, 2], h][x, y[1, 2, 3]]]

Out[2]//TreeForm= TreeForm[f[g[1, 2], h][x, y[1, 2, 3]]]
```

---

The structure ``"Subexpressions"`` gives a tree with the same shape as the one given by ``"Heads"``, but with data containing the subexpressions themselves rather than their heads:

```wl
In[1]:= ExpressionTree[f[g[1, 2], h][x, y[1, 2, 3]], "Subexpressions"]

Out[1]= [image]
```

The subtrees of the tree on level ``n`` correspond to the parts of the expression on level ``n``, excluding heads:

```wl
In[2]:= Level[f[g[1, 2], h][x, y[1, 2, 3]], {0}]

Out[2]= {f[g[1, 2], h][x, y[1, 2, 3]]}

In[3]:= Level[f[g[1, 2], h][x, y[1, 2, 3]], {1}]

Out[3]= {x, y[1, 2, 3]}

In[4]:= Level[f[g[1, 2], h][x, y[1, 2, 3]], {2}]

Out[4]= {1, 2, 3}
```

Include heads:

```wl
In[5]:= ExpressionTree[f[g[1, 2], h][x, y[1, 2, 3]], "Subexpressions", Heads -> True]

Out[5]= [image]

In[6]:= Level[f[g[1, 2], h][x, y[1, 2, 3]], {0}, Heads -> True]

Out[6]= {f[g[1, 2], h][x, y[1, 2, 3]]}

In[7]:= Level[f[g[1, 2], h][x, y[1, 2, 3]], {1}, Heads -> True]

Out[7]= {f[g[1, 2], h], x, y[1, 2, 3]}

In[8]:= Level[f[g[1, 2], h][x, y[1, 2, 3]], {2}, Heads -> True]

Out[8]= {f, g[1, 2], h, y, 1, 2, 3}
```

---

The structure ``"Atoms"`` gives a tree with the same shape as the one given by ``"Subexpressions"``, but storing data only in the leaf nodes:

```wl
In[1]:= ExpressionTree[f[g[1, 2], h][x, y[1, 2, 3]], "Atoms"]

Out[1]= [image]
```

The structure ``Null`` gives a tree with the same shape but no data:

```wl
In[2]:= ExpressionTree[f[g[1, 2], h][x, y[1, 2, 3]], Null]

Out[2]= [image]
```

---

Construct a tree from the heads in an expression:

```wl
In[1]:= ExpressionTree[1[2[3, 4], 5[6, 7]], "Heads"]

Out[1]= [image]
```

Use ``TreeFold`` to insert a parent node above each subtree:

```wl
In[2]:= TreeFold[Tree[f, {Tree[##]}]&, %]

Out[2]= [image]
```

This corresponds to mapping on the arguments in an expression:

```wl
In[3]:= TreeExpression[%, "Heads"]

Out[3]= f[1[f[2[3, 4]], f[5[6, 7]]]]
```

``Map`` maps on the arguments in an expression by default:

```wl
In[4]:= % === Map[f, 1[2[3, 4], 5[6, 7]], {0, -2}]

Out[4]= True
```

---

Construct a tree from the atoms in an expression:

```wl
In[1]:= ExpressionTree[1[2, 3][4[5, 6], 7[8, 9]], "Atoms", Heads -> True]

Out[1]= [image]
```

Use ``TreeFold`` to insert a sibling node before each subtree:

```wl
In[2]:= TreeFold[Tree[{f, Tree[##]}]&, %]

Out[2]= [image]
```

This corresponds to mapping on the subexpressions in an expression:

```wl
In[3]:= TreeExpression[%, "Atoms", Heads -> True]

Out[3]= f[f[1[2, 3]][f[4[5, 6]], f[7[8, 9]]]]
```

``Map`` maps on the subexpressions in an expression with ``Heads -> True`` :

```wl
In[4]:= % === Map[f, 1[2, 3][4[5, 6], 7[8, 9]], {0, -2}, Heads -> True]

Out[4]= True
```

---

Construct a tree from the heads in an expression:

```wl
In[1]:= ExpressionTree[1[2[3, 4], 5[6, 7]], "Heads"]

Out[1]= [image]
```

``TreeMap`` maps on the data of subtrees in a tree:

```wl
In[2]:= TreeMap[f, %, All]

Out[2]= [image]
```

This corresponds to mapping on the heads and leaves in an expression:

```wl
In[3]:= TreeExpression[%, "Heads"]

Out[3]= f[1][f[2][f[3], f[4]], f[5][f[6], f[7]]]
```

``Map`` can map on the heads and leaves directly:

```wl
In[4]:=
mapAtData[f_][head_[args___]] := f[head][args]
mapAtData[f_][expr_] := f[expr]

In[5]:= Map[mapAtData[f], 1[2[3, 4], 5[6, 7]], All]

Out[5]= f[1][f[2][f[3], f[4]], f[5][f[6], f[7]]]
```

---

Construct a tree from the atoms in an expression:

```wl
In[1]:= ExpressionTree[1[2, 3][4[5, 6], 7[8, 9]], "Atoms", Heads -> True]

Out[1]= [image]
```

``TreeMap`` can map on the data of just the leaves in a tree:

```wl
In[2]:= TreeMap[f, %, {-1}]

Out[2]= [image]
```

This corresponds to mapping on the atoms in an expression:

```wl
In[3]:= TreeExpression[%, "Atoms", Heads -> True]

Out[3]= f[1][f[2], f[3]][f[4][f[5], f[6]], f[7][f[8], f[9]]]
```

``Map`` can map on the atoms in an expression directly:

```wl
In[4]:= % === Map[f, 1[2, 3][4[5, 6], 7[8, 9]], {-1}, Heads -> True]

Out[4]= True
```

---

``Depth[expr]`` is equivalent to ``TreeDepth[ExpressionTree[expr]] + 1`` :

```wl
In[1]:= ExpressionTree[f[g[h]][a, b, c]]

Out[1]= [image]

In[2]:= TreeDepth[%] + 1

Out[2]= 2

In[3]:= Depth[f[g[h]][a, b, c]]

Out[3]= 2
```

---

``Depth[expr, Heads -> True]`` is equivalent to ``TreeDepth[ExpressionTree[expr, "Subexpressions"]] + 1`` :

```wl
In[1]:= ExpressionTree[f[g[h]][a, b, c], Heads -> True]

Out[1]= [image]

In[2]:= TreeDepth[%] + 1

Out[2]= 4

In[3]:= Depth[f[g[h]][a, b, c], Heads -> True]

Out[3]= 4
```

---

``ExpressionTree`` evaluates subexpressions before constructing the tree:

```wl
In[1]:= ExpressionTree[Today + Quantity[1, "Days"], "Subexpressions"]

Out[1]= [image]
```

Use ``Unevaluated`` to defer evaluation of subexpressions until after the tree is constructed:

```wl
In[2]:= ExpressionTree[Unevaluated[Today + Quantity[1, "Days"]], "Subexpressions"]

Out[2]= [image]
```

Held structures ensure that subexpressions are wrapped in ``HoldForm`` to prevent all evaluation:

```wl
In[3]:= ExpressionTree[Unevaluated[Today + Quantity[1, "Days"]], "HeldSubexpressions"]

Out[3]= [image]
```

Show the ``HoldComplete`` wrappers:

```wl
In[4]:= InputForm[%]
```

Out[4]//InputForm=
Tree[HoldComplete[Today + Quantity[1, "Days"]], 
 {Tree[HoldComplete[Today], None, {TreeElementLabelFunction -> 
     "HeldSubexpressions"}], Tree[HoldComplete[Quantity[1, "Days"]], 
   {Tree[HoldComplete[1], None, {TreeElementLabelFunction -> 
       "HeldSubexpressions"}], Tree[HoldComplete["Days"], None, 
     {TreeElementLabelFunction -> "HeldSubexpressions"}]}, 
   {TreeElementLabelFunction -> "HeldSubexpressions"}]}, 
 {TreeElementLabelFunction -> "HeldSubexpressions"}]

---

Construct a tree from an inactive expression:

```wl
In[1]:= ExpressionTree[Inactivate[Unevaluated[1 + 2 * 3]], "Heads"]

Out[1]= [image]
```

## See Also

* [`Tree`](https://reference.wolfram.com/language/ref/Tree.en.md)
* [`NestTree`](https://reference.wolfram.com/language/ref/NestTree.en.md)
* [`TreeExpression`](https://reference.wolfram.com/language/ref/TreeExpression.en.md)
* [`TreeForm`](https://reference.wolfram.com/language/ref/TreeForm.en.md)
* [`ExpressionGraph`](https://reference.wolfram.com/language/ref/ExpressionGraph.en.md)

## Related Guides

* [Tree Construction & Representation](https://reference.wolfram.com/language/guide/TreeConstructionAndRepresentation.en.md)
* [Computation on Trees](https://reference.wolfram.com/language/guide/ComputationOnTrees.en.md)
* [`Trees`](https://reference.wolfram.com/language/guide/Trees.en.md)

## History

* [Introduced in 2021 (12.3)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn123.en.md) \| [Updated in 2021 (13.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn130.en.md) ▪ [2022 (13.1)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn131.en.md) ▪ [2022 (13.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn132.en.md)