Skip to content
Guide · DataGrip

How to Export Query Results to Excel/CSV in DataGrip

DataGrip exports data through data extractors: pick Excel, CSV or another format, then send the full result to a file or the clipboard. This guide covers exporting a query result, exporting whole tables from the Database Explorer, the options in the Export Data dialog, and the clipboard behaviour that catches people out.

Steps and facts checked 8 October 2026 against the vendor's official documentation. Versions covered: DataGrip 2026.2. Next review due April 2027. Menus, shortcuts and prices change between releases; check the vendor's documentation for your version.
Short answer
  • To export a query result, click Export Data on the result toolbar, choose the Excel (xlsx) or CSV extractor, and click Export to File.
  • Ctrl+C copies only the selected rows on the current page of results; use Export Data or Export Table to Clipboard for the full result.
  • For Excel, the Output query to a separate sheet option adds a sheet containing the SQL that produced the data.
  • To export whole tables, right-click them in the Database Explorer and choose Import/Export | Export Data to File; each table becomes its own file.
How we know: Research-based: the steps and options were checked against the DataGrip documentation (Export and Data extractors) on 8 October 2026. We have not run these exports for the guide; labels are quoted from JetBrains' documentation.

DataGrip export to Excel from a query result

This is the usual DataGrip export to Excel route for the output of a query:

  1. Run the query in a query console (Ctrl+Enter on Windows, Cmd+Enter on macOS). The result appears in the results tab.
  2. On the result toolbar, click Export Data.
  3. In the Export Data dialog, set Extractor to Excel (xlsx).
  4. Choose the options you need: Add column header for a header row, Add row header for row numbers, Transpose to swap rows and columns, and Output query to a separate sheet to add a Query sheet holding the SQL.
  5. Set the Output file and click Export to File.

The export takes the full result, not only the rows on screen. The Excel extractor writes .xlsx or .xls.

Export query results to CSV

The steps are the same with the CSV extractor selected. DataGrip quotes cells that contain commas, so values such as "Ortiz, Daniel" survive the round trip. For semicolon, tab or pipe-separated output, open the extractor list and choose Configure CSV Formats: there you can define the value and row separators, the text written for NULL, the quotation characters and when values are quoted (Never, When needed or Always). New formats then appear in the extractor list.

The extractor you choose last becomes the default for new editor tabs, so check the list before your next export.

Formats you can export to

You can also write your own extractor in Groovy or JavaScript and place it in the extractors folder under Scratches and Consoles | Extensions | Database Tools and SQL | data.

Built-in and scripted data extractors listed in the DataGrip documentation
ExtractorFile formatTypical use
Excel.xlsx, .xlsSpreadsheets for colleagues
CSV, TSV.csv, .tsvLoading into other tools and databases
Pipe-separated.txtPlain-text tables
JSON.jsonAPIs and scripts
Markdown, HTML (Groovy or JavaScript).md, .htmlDocumentation and reports
XML.xmlSystems that expect XML
SQL Inserts, SQL Updates, SQL-Insert-Multirow, SQL-Insert-Statements.sqlMoving rows to another database
Pretty.txtReadable fixed-width text

Copying results to the clipboard

  • Ctrl+C copies only the selected cells on the current page of results.
  • Ctrl+A then Ctrl+C copies every row on the current page.
  • Export Data | Copy to Clipboard, or right-click a cell and choose Export Table to Clipboard, copies the full result using the current extractor.

Choosing a TSV or CSV extractor before copying makes the clipboard paste cleanly into a spreadsheet. If you only see part of a large result, the page size is limited in Settings | Database | Data Editor and Viewer; that limits what is displayed and copied with Ctrl+C, while Export Data still takes everything.

Export whole tables, structure and full dumps

Tables. In the Database Explorer, select one or more tables or views, right-click and choose Import/Export | Export Data to File. A separate file is created for each table or view.

Structure. DataGrip exports structure and data separately. For DDL, right-click an object and choose SQL Scripts | SQL Generator (Ctrl+Alt+G), or Generate DDL to Query Console or Generate DDL to Clipboard.

Full dumps. For a backup-style dump DataGrip runs the database's own tools: Export with 'mysqldump' for MySQL, Export with 'pg_dump' for PostgreSQL and Export with 'bcp' for SQL Server tables. These tools are not part of DataGrip, so you give the full path to the executable.

Frequently asked questions

How do I export a DataGrip query result to Excel?

Click Export Data on the result toolbar, choose the Excel (xlsx) extractor, set the output file and click Export to File.

Why did DataGrip copy only some of my rows?

Ctrl+C copies the selection on the current page only. Use Export Table to Clipboard or Export Data to take the whole result.

Can DataGrip include the SQL query in the Excel file?

Yes. Select Output query to a separate sheet in the Export Data dialog; DataGrip adds a Query sheet with the SQL.

Can I export several tables at once?

Yes. Select them in the Database Explorer and choose Import/Export | Export Data to File. Each table is written to its own file.

How do I export to CSV with a semicolon delimiter?

Choose Configure CSV Formats in the extractor list, add a format with a semicolon value separator, and select it before exporting.

Sources

Checked 8 October 2026.

How we research tool guides: our editorial method. CodeWithSQL earns nothing from the vendors mentioned.

Still choosing a SQL client?

Read the full reviews, or compare tools side by side.