Save
✖
Save
Details and Options

- Save uses FullDefinition to include subsidiary definitions.
- Save writes out definitions in InputForm.
- Save uses Names to find symbols whose names match a given string pattern.
- You can use Save["filename","s"] to write out the definition for the value of a symbol s itself.
- Save works with local and cloud objects.
- Save[File["filename"],…] is also supported.
- The following options can be given:
-
ExcludedContexts Automatic contexts excluded from recursive inclusion IncludedContexts All contexts considered for recursive inclusion
Examples
open allclose allBasic Examples (2)Summary of the most common use cases

https://wolfram.com/xid/0dehyq-5gsu8b


https://wolfram.com/xid/0dehyq-f12661
Save the value of the variable in a file:

https://wolfram.com/xid/0dehyq-wd4v02
Loading the file restores the value of a:

https://wolfram.com/xid/0dehyq-9aqidl

https://wolfram.com/xid/0dehyq-mkj09b

https://wolfram.com/xid/0dehyq-vb0e4x


https://wolfram.com/xid/0dehyq-n6u8v8
Create multiple definitions to save:

https://wolfram.com/xid/0dehyq-cli7zk
Save the definitions to standard out to see how they would be written to a file:

https://wolfram.com/xid/0dehyq-gzks5w
Scope (3)Survey of the scope of standard use cases
Save a definition into a file specified by the File object:

https://wolfram.com/xid/0dehyq-hrlyj9


https://wolfram.com/xid/0dehyq-maythx

https://wolfram.com/xid/0dehyq-cpyngv

https://wolfram.com/xid/0dehyq-gpj03s

https://wolfram.com/xid/0dehyq-cvtvb


https://wolfram.com/xid/0dehyq-cgfp9
Local objects can be used with Save to save definitions persistently:

https://wolfram.com/xid/0dehyq-4btbbh

https://wolfram.com/xid/0dehyq-b345oq

Cloud objects can be used with Save to save definitions in the cloud:

https://wolfram.com/xid/0dehyq-m267bx

https://wolfram.com/xid/0dehyq-dxttny

Options (2)Common values & functionality for each option
ExcludedContexts (1)
By default, certain system-internal contexts are excluded from recursive inclusions:

https://wolfram.com/xid/0dehyq-vqaal5

https://wolfram.com/xid/0dehyq-n3auqk
Use ExcludedContexts{} to save definitions of all non-protected symbols:

https://wolfram.com/xid/0dehyq-bgvoaa
Applications (1)Sample problems that can be solved with this function
Properties & Relations (3)Properties of the function, and connections to other functions
Save writes the output of FullDefinition to a file:

https://wolfram.com/xid/0dehyq-h9fdu5

https://wolfram.com/xid/0dehyq-cqu14g

https://wolfram.com/xid/0dehyq-pljam
Saved definitions can be read into the Wolfram Language using Get:

https://wolfram.com/xid/0dehyq-fsqufo

https://wolfram.com/xid/0dehyq-j3tiit


https://wolfram.com/xid/0dehyq-enk699
Print the contents of the saved file:

https://wolfram.com/xid/0dehyq-dnc59
Clear definitions in the current session:

https://wolfram.com/xid/0dehyq-6w2l4

Get the definitions into the current session:

https://wolfram.com/xid/0dehyq-dv8e3i

https://wolfram.com/xid/0dehyq-czhy9d

By default, definitions attached to "System`" symbols are not pulled in:

https://wolfram.com/xid/0dehyq-5yozo9
Use ExcludedContexts{} to pull in definitions from all contexts:

https://wolfram.com/xid/0dehyq-g6j7jw
Alternatively, attach definitions to your own symbols:

https://wolfram.com/xid/0dehyq-8gcoop

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