How to open .CUB files on Linux

To open .CUB files on Linux, use Open Babel to read/convert the Gaussian cube (.cub/.cube) file (for example, for format conversion or basic validation).

Step-by-step instructions

  1. Use Open Babel to read/convert the Gaussian cube (.cub/.cube) file (for example, for format conversion or basic validation).
  2. For scripting/analysis workflows, use a chemistry/scientific toolchain that supports the Cube structure (header, atoms, 3D grid) to parse it.
  3. If your desktop environment prompts for an app, choose the installed tool that explicitly lists Gaussian cube/Cube support.

Alternative methods

  • Open .CUB in a browser-based viewer if desktop apps fail.
  • Try opening .CUB on Linux with a secondary app to rule out app-specific issues.
  • Convert .CUB only with trusted tools when direct opening is not possible.

Common issues

The .CUB file opens as plain text or looks like numbers and coordinates

Gaussian Cube files are plain-text scientific data, so a text editor will show comments, atom coordinates, and long blocks of grid values rather than a visual model.

  1. Open the file with a Cube-capable scientific tool (for example Open Babel for conversion/inspection, or a workflow that can visualize volumetric grids).
  2. If your goal is visualization, convert the Cube file to a format your visualization tool supports using Open Babel.

App says the file is invalid or cannot be parsed

Parsers may fail if the Cube header/grid dimensions do not match the amount of data, if the file was truncated, or if the file is not actually a Gaussian Cube despite using .cub.

  1. Confirm the file is a Gaussian Cube file (it should contain header lines, atom list, and 3D grid data).
  2. Re-download or re-export the file to ensure it is complete (large grids are easy to truncate during transfer).
  3. Try reading/converting it with Open Babel to see whether it recognizes the file and can round-trip it.

The file is extremely large or slow to open

Cube files can be very large because they store full 3D grids of values; higher grid resolution increases size and load time.

  1. If you control the export, regenerate the Cube with a coarser grid or smaller region of interest.
  2. Use a tool that can handle large volumetric grids efficiently, or convert to a format better suited for your downstream software.

Confusion between .cub and .cube extensions

The Gaussian cube format is commonly referenced with both .cub and .cube; some tools may prefer one extension even though the structure is the same.

  1. Check your tool’s documentation for whether it expects .cub or .cube for auto-detection.
  2. If needed, keep the content unchanged and only adjust the extension to the expected one (this is not a “conversion,” just a naming convention some tools rely on).

Security note

Gaussian Cube files are plain text and typically do not contain active content (no macros or scripts), but they can still trigger crashes or vulnerabilities in poorly-written scientific parsers—prefer reputable, well-maintained tools for opening files from untrusted sources.

Back to .CUB extension page