Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
FITS (.fits, .fit)
  • See Also
    • Import
    • Export
    • CloudExport
    • CloudImport

    • Formats
    • CDF
    • GIF
    • HDF
    • HDF5
    • JPEG
    • NetCDF
    • PNG
    • TIFF
  • Related Guides
    • Graphics Importing & Exporting
    • Importing & Exporting
    • Listing of All Formats
    • Raster Image Formats
    • Scientific & Medical Data Formats
    • See Also
      • Import
      • Export
      • CloudExport
      • CloudImport

      • Formats
      • CDF
      • GIF
      • HDF
      • HDF5
      • JPEG
      • NetCDF
      • PNG
      • TIFF
    • Related Guides
      • Graphics Importing & Exporting
      • Importing & Exporting
      • Listing of All Formats
      • Raster Image Formats
      • Scientific & Medical Data Formats
IMPORT/EXPORT FORMAT
  • See Also
    • Import
    • Export
    • CloudExport
    • CloudImport

    • Formats
    • CDF
    • GIF
    • HDF
    • HDF5
    • JPEG
    • NetCDF
    • PNG
    • TIFF
  • Related Guides
    • Graphics Importing & Exporting
    • Importing & Exporting
    • Listing of All Formats
    • Raster Image Formats
    • Scientific & Medical Data Formats
    • See Also
      • Import
      • Export
      • CloudExport
      • CloudImport

      • Formats
      • CDF
      • GIF
      • HDF
      • HDF5
      • JPEG
      • NetCDF
      • PNG
      • TIFF
    • Related Guides
      • Graphics Importing & Exporting
      • Importing & Exporting
      • Listing of All Formats
      • Raster Image Formats
      • Scientific & Medical Data Formats

FITS (.fits, .fit)

  • Import and Export fully support the image, ASCII table, and binary table extensions of the FITS file format.

Background & Context

    • MIME types: application/fits, image/fits
    • FITS scientific image and data format.
    • Standard format for the exchange and archival storage of astronomical data.
    • Endorsed by NASA and the International Astronomical Union.
    • FITS is an acronym for Flexible Image Transport System.
    • Allows multiple header-data units (HDUs).
    • Each HDU can be an image, an ASCII table or a binary table.
    • Image HDUs can only store arrays of single-channel 2D images.
    • Binary and ASCII table HDUs can only store 2D data.
    • Elements of a binary table can be multidimensional arrays.
    • Stores spectral data and raster images as arrays.
    • Developed in 1979 by Don Wells, Eric Greisen, and others.

Import & Export

  • Import["file.fits"] imports a FITS file as an image or an array of data values, depending on the HDU type, for a single HDU file.
  • Import["file.fits"] returns an association of the form <|1->hdu1,…|> for all HDUs in the file.
  • Import["file.fits",elem] imports the specified element from a FITS file.
  • Import["file.fits",{elem, i}] returns elem stored in the i^(th) HDU.
  • The import format can be specified with Import["file","FITS"] or Import["file",{"FITS",elem,…}].
  • Export["file.fits",expr] exports images and graphics as an image to a FITS file, at their raster sizes.
  • Export["file.fits",expr] exports string and numeric arrays as a table to a FITS file.
  • Export["file.fits",1->expr1,…] exports expri to the i^(th) HDU.
  • See the following reference pages for full general information:
  • Import, Exportimport from or export to a file
    CloudImport, CloudExportimport from or export to a cloud object
    ImportString, ExportStringimport from or export to a string
    ImportByteArray, ExportByteArrayimport from or export to a byte array

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • Structure elements:
  • "HDUCount"number of HDUs
    "Summary"summary of the file
    "SummarySlideView"slide-view summary of all HDUs
  • All elements of a FITS file are imported as a numbered association, returned in the form 1val1,2val2,….
  • Data representation elements:
  • "Data"array of pixel values or table elements
    "Plaintext"representation of image and table extensions as a string
    "RawData"raw data as stored in the file
  • Additional elements, available for image HDUs:
  • "Graphics"raster image, given as a Graphics object
    "Image"raster image, given as an Image object
    "IndeterminateMask"a SparseArray representing indeterminate values in the image
  • Additional elements, available for binary and ASCII table HDUs:
  • "TableData"representation of table extension
    "TableHeaders"table column headers
    "TableUnits"units of measurement corresponding to the table columns
  • Import and Export by default use the "Image" element for image HDUs and the "Data" element for binary and ASCII table HDUs.
  • Subelements for partial data import can be given in one of the following forms:
  • {elem,hdu}for any element
    {elem,hdu,rows,cols}for data elements of single-image and table HDUs
    {elem,hdu,spec1,spec2,…,rows,cols}for data elements of higher-dimensional image HDUs
  • Part specification for hdu, speci, rows and cols can be any of the following:
  • Allall HDUs
    nnth HDU
    n;;mHDU n through m
    n;;m;;sfrom n through m with steps of s
    {n1,n2,…}specific HDUs ni
  • Advanced elements:
  • "BitDepth"bits used to represent gray-level pixels in the file
    "Channels"the number of color channels used in the file
    "ColorSpace"color encoding used in the file
    "DataType"data type used to store image or table data in the file
    "Dimensions"data dimensions
    "Extension"type of the HDU extension
    "ImageSize"raster dimensions of a single frame
    "Range"minimum and maximum raw data values
  • General metadata elements:
  • "MetaInformation"processed metadata
    "RawMetaInformation"raw metadata as stored in the file
  • Information about the recording device and environment:
  • "Airmass"relative airmass
    "Declination"declination setting of the telescope axis
    "Device"recording instrument (e.g. camera)
    "Equinox"equinox for the celestial coordinate system used in this file, typically given in years
    "ExposureTime"photographic exposure time in seconds
    "HourAngle"hour angle of the depicted object when the image was taken
    "ObservationDate"date and time the observation was made
    "RightAscension"right ascension setting of the telescope axis
    "SiderealTime"sidereal time (LST)
    "Telescope"telescope that captured the image
  • Bibliographic information elements:
  • "Author"person who compiled the image information
    "Reference"bibliographic reference associated with this file
  • Other common metadata elements:
  • "Comments"comments for each piece of data or image stored in the file
    "History"description of how the data or image has been processed
    "Object"name of the observed object
    "Observer"person who recorded the data or image
    "Organization"organization or institution responsible for creating this file
  • Metadata field names are converted to all caps on export to conform with FITS standard.

Options

  • Import and Export option:
  • DataReversedAutomaticwhether to reverse the order of rows
  • Import options:
  • ColorFunctionAutomatichow each cell should be colored
    ImageSizeAutomaticoverall image size
    "Gamma"1.0gamma correction parameter used for rendering
    "IncludeExtensions"AllHDU extensions to import
    "IncludeHeaders"Falsewhether to import table headers
  • Export options:
  • "Append"Falsewhether to append to an existing file
    "CompressionMethod"Nonecompression algorithm to use on export
    MetaInformationNonemetainformation per header to be added on export
  • Possible settings for "CompressionMethod" include "GZIP", "GZIPShuffled", "Rice", "HCompress" and "PLIO".

Examples

open all close all

Basic Examples  (3)

Import a FITS file containing image data:

Import a FITS file with multiple HDUs:

Export an image to FITS:

Scope  (7)

Import  (2)

Import all HDUs:

Import image HDUs only:

Import metadata such as data dimensions:

Summary of a FITS image file:

Summary of a multi-HDU file:

Export  (5)

Export an image:

Export a table with columns that conform in type:

Note that table data cannot be stored in the first HDU:

Create a multi-HDU file:

Create a multi-HDU file with explicit extensions:

Export a table with multidimensional elements:

Import Elements  (44)

Available Elements  (2)

List of available elements:

Import all elements as a list of rules:

Data Representation  (17)

"Data"  (2)

Import the image data:

Construct the images using the proper type:

Import a binary table:

"DataType"  (1)

Import the type of data stored in a FITS file:

"Graphics"  (2)

Import image data stored in a file as a Graphics object:

Import part of graphics:

"Image"  (2)

Import image data stored in a file as an Image object:

Import part of image:

"Plaintext"  (1)

Import the data stored in a file as a string:

"Range"  (1)

Import the range of data values stored in a file:

For "Image" HDUs, this is the same as the min and max of raw data:

For tabular HDUs, the range is computable only for numeric parts of the table:

"RawData"  (2)

Import the raw data stored in a file:

Construct the images using the proper type:

Import part of raw data:

"TableData"  (3)

Import table data from a file:

The "TableData" element imports only the table HDUs:

Import part of table data:

"TableHeaders"  (2)

Import the table column headers stored in a file:

The "TableHeaders" element imports headers only from the table HDUs:

"TableUnits"  (1)

Import the units of measurement corresponding to the table columns stored in a file:

Advanced Import Elements  (6)

"BitDepth"  (1)

Import the number of bits used to represent the data stored in a file:

"Dimensions"  (1)

Import the dimensions of data stored in a file:

"Extension"  (1)

Import the types of HDUs stored in the file:

"ImageSize"  (1)

Import the size of each image frame stored in a file:

"Summary"  (1)

Import the summary of a file:

"SummarySlideView"  (1)

Import the summary of all HDUs stored in a file:

Metadata Elements  (19)

"Airmass"  (1)

Get the relative airmass of an image date stored in a file:

"Author"  (1)

Get the name of the person who compiled the data stored in a file:

"Comments"  (1)

Get the comments stored in a FITS file:

"Declination"  (1)

Get the declination setting of the telescope axis:

"Device"  (1)

Get the manufacturer of the recording equipment:

"Equinox"  (1)

Get the equinox for the celestial coordinate system used in this file:

"ExposureTime"  (1)

Get the photographic exposure time in seconds:

"History"  (1)

Get the description of how the data stored in a file has been processed:

"HourAngle"  (1)

Get the hour angle of the depicted object when the image was taken:

"MetaInformation"  (1)

Get the processed metadata from a file:

"Object"  (1)

Get the name of the observed object:

"ObservationDate"  (1)

Get the date and time the observation was made:

"Observer"  (1)

Get the name of the person who recorded the data stored in a file:

"Organization"  (1)

Get the name of the organization or institute the created the data stored in a file:

"RawMetaInformation"  (1)

Get the raw metadata from a file:

"Reference"  (1)

Get the bibliographic reference associated with a file:

"RightAscension"  (1)

Get the right ascension setting of the telescope axis:

"SiderealTime"  (1)

Get the sidereal time (LST) stored in a file:

"Telescope"  (1)

Get the telescope name used for capturing the data stored in a file:

Export Elements  (4)

"Data"  (2)

Export expression as data:

"Rules"  (2)

Export data as list of rules:

Export data and metadata as a list of rules:

Import Options  (6)

ColorFunction  (1)

By default, the image data is imported as an Image object with no color function applied:

Apply a specific color function on import:

DataReversed  (1)

By default, image data stored in a file is reversed only if that is specified in the metadata:

Force the image data to be reversed during the import:

ImageSize  (1)

By default, images are imported in their full resolution:

Specify the raster size of the imported image:

"Gamma"  (1)

By default, gamma correction is not applied:

Apply a gamma correction:

Apply a gamma correction as well as a color function:

"IncludeExtensions"  (1)

By default, all the applicable types of HDUs present in a FITS file are imported:

Import all HDUs present:

Import the element only for "Image" HDUs:

Import an element for multiple types of HDUs:

"IncludeHeaders"  (1)

By default, the headers are not present in the imported table data:

Import data with no table headers:

Export Options  (3)

Append  (1)

Export an image:

By default, the second export to the same file will overwrite it:

DataReversed  (1)

By default, image data is not reversed during the export:

Force image data to be reversed during the export:

"CompressionMethod"  (1)

By default, no compression is applied during the export:

Compare the file sizes using different compression methods:

Possible Issues  (2)

File names containing '(' and '[' characters are not supported:

Note that the file with those special characters cannot be imported either:

Binary table data cannot store multidimensional cells that contain string values:

See Also

Import  Export  CloudExport  CloudImport

Formats: CDF  GIF  HDF  HDF5  JPEG  NetCDF  PNG  TIFF

Related Guides

    ▪
  • Graphics Importing & Exporting
  • ▪
  • Importing & Exporting
  • ▪
  • Listing of All Formats
  • ▪
  • Raster Image Formats
  • ▪
  • Scientific & Medical Data Formats

History

Introduced in 2002 (4.2) | Updated in 2019 (12.0)

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English