generates a string corresponding to expr exported in the specified format.
gives explicit rules for different elements of the data to be exported.
Details

- ExportString handles a large number of formats, each typically with many different possible elements. The possible formats are given in the list $ExportFormats, and in the "Listing of All Formats".
- ExportString works just like Export, with the same element specifications and options.
- Many graphics, sound, and binary formats yield strings containing non‐printable characters.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (3)Survey of the scope of standard use cases
Export an array to a "CSV" string:

https://wolfram.com/xid/0eny0c7yq-0ny54v

Export the same array to a "JSON" string:

https://wolfram.com/xid/0eny0c7yq-retwv7

Export a graph as a "Graph6" string:

https://wolfram.com/xid/0eny0c7yq-7hwac3

Export with an option to suppress the header:

https://wolfram.com/xid/0eny0c7yq-pzc3jp

Export multiple graphs as "Graph6" strings:

https://wolfram.com/xid/0eny0c7yq-mfa6mu

Many formats give strings containing non-printable characters:

https://wolfram.com/xid/0eny0c7yq-mnoiv5


https://wolfram.com/xid/0eny0c7yq-e4afn2

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