NotebookReadCopy to clipboard.
✖
NotebookRead

gives the expression corresponding to the current selection in the specified notebook object.
gives the expression corresponding to the given cell or box object.
gives a list of expressions corresponding to the obji.
Details and Options

- NotebookRead is the basic way to get into the kernel pieces of notebooks that are being manipulated by the front end.
- NotebookRead can take a NotebookObject, CellObject, or BoxObject.
- If a list of CellObject or BoxObject expressions is given, then a list of equal length will be returned, with the expressions corresponding to each object.
- If an object is no longer valid, NotebookRead returns $Failed. If a list of objects is given, then $Failed will be returned for each of the invalid objects.
- The following options can be given:
-
CellContext None context to substitute for $CellContext` StripCellGrouping False whether to strip cell grouping when reading contiguously selected cells - When NotebookRead[notebook] reads a contiguous selection of cells, selected cell groups are returned as Cell[CellGroupData[…]] expressions by default. The option setting StripCellGroupingTrue will force selected cells to be returned as a flat list regardless of grouping.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
This creates a document notebook:

https://wolfram.com/xid/0tz3xk3u-cu28j


https://wolfram.com/xid/0tz3xk3u-tv3co
This reads the cell and returns its Cell expression:

https://wolfram.com/xid/0tz3xk3u-g8k3rh

Read a CellObject:

https://wolfram.com/xid/0tz3xk3u-kqcbxw

Read a BoxObject:

https://wolfram.com/xid/0tz3xk3u-m3hszb

Scope (1)Survey of the scope of standard use cases
Create a notebook and move the selection to the first "T":

https://wolfram.com/xid/0tz3xk3u-f58vje

https://wolfram.com/xid/0tz3xk3u-fyci5s

https://wolfram.com/xid/0tz3xk3u-gv7v7p

Select multiple cells and read the content:

https://wolfram.com/xid/0tz3xk3u-izhf0

https://wolfram.com/xid/0tz3xk3u-iewwuq


https://wolfram.com/xid/0tz3xk3u-cuk91l

https://wolfram.com/xid/0tz3xk3u-jj1w3

https://wolfram.com/xid/0tz3xk3u-kxyk68

Options (2)Common values & functionality for each option
CellContext (1)
Create a target cell with a raw expression in it:

https://wolfram.com/xid/0tz3xk3u-fs81il
Read the cell using NotebookRead:

https://wolfram.com/xid/0tz3xk3u-o8kwhi

Use CellContext to substitute a value for the $CellContext` context:

https://wolfram.com/xid/0tz3xk3u-kr1azy

StripCellGrouping (1)
Reading a group of cells includes CellGroupData constructs by default:

https://wolfram.com/xid/0tz3xk3u-bc5imh

Use StripCellGrouping to remove the grouping information:

https://wolfram.com/xid/0tz3xk3u-rgh8f

Wolfram Research (1996), NotebookRead, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookRead.html (updated 2024).
Text
Wolfram Research (1996), NotebookRead, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookRead.html (updated 2024).
Wolfram Research (1996), NotebookRead, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookRead.html (updated 2024).
CMS
Wolfram Language. 1996. "NotebookRead." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/NotebookRead.html.
Wolfram Language. 1996. "NotebookRead." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/NotebookRead.html.
APA
Wolfram Language. (1996). NotebookRead. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NotebookRead.html
Wolfram Language. (1996). NotebookRead. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NotebookRead.html
BibTeX
@misc{reference.wolfram_2025_notebookread, author="Wolfram Research", title="{NotebookRead}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/NotebookRead.html}", note=[Accessed: 14-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_notebookread, organization={Wolfram Research}, title={NotebookRead}, year={2024}, url={https://reference.wolfram.com/language/ref/NotebookRead.html}, note=[Accessed: 14-March-2025
]}