Skip to content

Data File Types and Formats

File formats are the method by which data is organized and stored in a computer file. A file format standard is an agreed upon method for organizing data within a file. Standard formats exist for many data types, including images, audio and video files, remote sensing, CAD and GIS data, Using an agreed upon standard can simplify the exchange of information as tools or applications can be developed to use the common format. For example JPEG image files can be viewed and even edited with the correct software on just about any device. Standards can also slow adoption of newer technologies, as both JPEG 2000 and HEIC image files have improved compression, metadata handling and security over the older JPEG standard but are still not as widely adopted making their use more cumbersome.

File storage types

Here we discuss that major file storage types. These are not specific formats, so do not control how data is structured in the file, but instead discuss the primary method used to store and interpret data on a computer system. Specifically, storing data as plain text, binary, hybrid or compressed.

Plain Text Files

Everything on a computer is at its core a binary number, since computers do everything with bits that represent 0 and 1. In order to have a file that is "plain text", so human readable with minimal intervention, binary values must be mapped to specific letters. This process is typically called encoding. Almost everything is now encoded using UNICODE, but there are still some older files and documentation that refer to older standards, especially ASCII which was dominant in the United States and therefore throughout the world for many decades. The most common UNICODE system, UTF-8 is backwards compatible with ASCII, meaning that many people will still refer to ASCII encoding even when a file is UTF-8.

Here are some additional details on plain text encoding systems:

American Standard Code for Information Interchange (ASCII)

  • An ASCII text file is one in which each byte represents one character according to the ASCII code.
  • ASCII files are human readable and are sometimes called plain text files though in reality they are binary files with a standard interpretation.
  • For an example of the ASCII table definition, refer to this version of the ASCII table, which illustrates how binary numbers are assigned to standard English language characters.
  • ASCII files are relatively simple to structure and do not require special tools to read so they are commonly used for data storage.
  • Data corruption is often easier to identify and recover from since the file should be readable using many common text editing and viewing tools.
  • ASCII files have low entropy - information stored in an ASCII file typically occupies more storage than is strictly necessary.

UNICODE

The Unicode Consortium is the standards body for the internationalization of software and services. Before the Unicode standard was developed, there were many different systems, called character encodings (such as ASCII), for assigning these numbers. These earlier character encodings were limited and did not cover characters for all the world’s languages. Even for a single language like English, no single encoding covered all the letters, punctuation, and technical symbols in common use. Pictographic languages, such as Japanese, were a challenge to support with these earlier encoding standards.

Early character encodings also conflicted with one another. That is, two encodings could use the same number for two different characters, or use different numbers for the same character. Any given computer might have to support many different encodings. However, when data is passed between computers and different encodings it increased the risk of data corruption or errors.

The two primary Unicode encodings you are likely to work with are UTF-8 and UTF-16:

  • UTF-8 (Unicode Transformation Format – 8-bit). UTF-8 is capable of encoding all 1,112,064 valid Unicode scalar values using a variable-width encoding of one to four one-byte (8-bit) code units. It was designed for backward compatibility with ASCII: the first 128 characters of Unicode, which correspond one-to-one with ASCII, are encoded using a single byte with the same binary value as ASCII, so that a UTF-8-encoded file using only those characters is identical to an ASCII file. Most software designed for any extended ASCII can read and write UTF-8 (including on Microsoft Windows) and this results in fewer internationalization issues than any alternative text encoding.

  • UTF-16 (16-bit Unicode Transformation Format). UTF-16 encoding is variable-length as code points are encoded with one or two 16-bit code units and is also capable of encoding all Unicode scalar values. UTF-16 is used by the Windows API, and therefore by many programming environments such as the Java programming language and JavaScript/ECMAScript. It is also sometimes used for plain text and word-processing data files. UTF-16 is the only encoding (still) allowed on the web that is incompatible with 8-bit ASCII, but its adoption has been very limited and it is considered less secure than UTF-8 for web applications.

Binary Files

All computers store information in binary form, specifically as bits (binary digits). Eight bits make up one byte. As everything stored on a computer is technically a file containing binary data, we will use the term "binary file" to mean a file that is mostly computer but not human readable. Many files contain a combination of binary and text formats. Such files are usually considered to be binary. For example, files that have been formatted with a word processor may encode written characters using a plain text format (UTF-8 or UTF-16 now), but encode additional information such as formatting instructions and embedded images using binary coding. Such mixed files should be treated as binary to preserve the original data when, for example, transmitting the files between computer systems using FTP or other file transfer protocols.

Note

The use of some mixed formats, such as employed by early word processors, has become less common in recent years as large companies have adopted new open data models. For example, Microsoft Office started the switch to human readable XML formats in the 2000s, with the Office Open XML formation (such as .docx, .xlsx) becoming the default in Office 2007.

The eXtensible Markup Language (XML) is a text-based markup language that stores data in a human-readable and machine-readable format. Similar to HTML, which is the base language for websites, but designed to be much more general in the data it can store.

Binary formats are most commonly used when space or computer efficiency are most valued. Since they are are stored in a way convenient for the machine, read and write operations are very efficient. Binary files are also the only way to store exact values from the computer, since writing a binary number using decimal digits will require the loss of precision for many floating point numbers. Binary files are also typically more compact than plain text files as information (specifically numbers) occupy storage more in line with what they actually require.

Hybrid files

Many data file types are more of a hybrid, with both plain text and binary components. One example of this that you are likely familiar with are Adobe PDF files. The PDF (Portable Document File) is often a combination of vector graphics, text, and bitmap graphics. The basic types of content in a PDF are:

  • Typeset text stored as content streams (i.e., not encoded in plain text);
  • Vector graphics for illustrations and designs that consist of shapes and lines;
  • Raster graphics for photographs and other types of images; and
  • Other multimedia objects.

The PDF is organized using primarily plain text, though some objects may have binary content. For example, typeset text and vector graphics along with document metadata are typically encoded using plain text, while raster images and other multimedia objects are more likely encoded using embedded binary information.

Plain text is generally easier to port between systems, since since single bytes do not suffer from issues of endianness and are more easily read and interpreted by software packages as nothing is hidden. Binary data provides efficiencies in loading data and in reducing file sizes. The hybrid approach tries to maximize the benefits of both without taking on too many of the negatives.

Compressed and archive files

Data compression is the process of encoding information using fewer bits than required by the original representation. Archiving usually involves the bundling of multiple files and folders into a single file that is easier to store and share. Compression and archiving files are presented here as a file type because they typically have to be uncompressed or unarchived before the data can be access. Compression and archive files are an intermediate point between data files that start and end as one of the previously describe file types.

A device or code that performs data compression is referred to as an encoder, and one that performs the reversal of the process (decompression) as a decoder. Data compression algorithms present a space–time complexity trade-off between the bytes needed to store or transmit information, and the computational resources needed to perform the encoding and decoding. The design of data compression schemes involves balancing the degree of compression, the amount of distortion introduced (when using lossy data compression), and the computational resources or time required to compress and decompress the data.

Compression is either lossy or lossless.

  • Lossless compression reduces bits by identifying and eliminating statistical redundancy. No information is lost in lossless compression.
  • Lossy compression reduces bits by removing unnecessary or less important information.

Lossless compression is more likely to be used for large data files were loss of data is deemed unacceptable. The performance of lossless compression algorithms will vary a lot based on the statistical similarity / redundancy of the source dataset. A dataset with a lot of repeating or redundant information, such as a lot of No Data values, will be compressed much smaller than a dataset that is more densely filled with non-repeating data.

Lossy data is most often used where the impact of lost data is least likely to be noticed. For example, in digital photos or audio. There the compression algorithm is based on the idea that human senses will compensate for missing data, so compression of a photo can reduce the size of the photo file by reducing the details within the photo, while still capturing the primary sense of the image. For example, saving the details within a brick in a brick wall is less important than preserving a shapes of the bricks as the sense of there being a brick wall will be preserved. Lossy compression will result in similar reductions in file size based on the compression level and not the data contents. However, high levels of compression will become visible in the rendering as too much detail is lost or distorted. Additionally, as data is lost in the compression process, every subsequent decompression will lose more data.

An archive files can be compressed or uncompressed. The Tape ARchive or "tar" file is an early and still relevant archive file format. it will bundle any number of files and folders into a single object. A tar file is uncompressed, but can be compressed during creation, say by running the process through the gzip encoder to create a "tgz" file. Or by compressing the resulting tar file using a separate encoder in a two step process.

Many modern encoders can also compress directories and their contents, which blurs the line between archiving and compressing data files.

Note

Be careful about using proprietary compression algorithms, since support for decompressing your files may be harder to find.

Major types of file formats

These lists pull from multiple sources on the internet, including Geeks for Geeks List of File Formats, File Format Basics from the Ohio State University, various AI generated summaries, and are then curated by Dr. Cherkauer to focus on file formats you are most likely to run into as part of your research. It is not designed to be comprehensive, and is likely already out of date.

Note

File extensions are some of the most common but are not always comprehensive. Refer to format description pages for more options.

Plain text file formats

Here are some examples of plain text file formats that you might encounter.

Extension Full name Description
.txt Plain text A file that contains plain text, could be a delimited data file, but there is no "required" data structure.
.asc ASCII text A file that contains ASCII text, similar to the .txt file in that there is no default data structure.
.csv Comma Separated Variable A plain text file that is rows and columns of data where columns are demarked using commas.
.html or .htm HyperText Markup Language The standard markup language for creating web pages.
.md Markdown A lightweight markup language for creating formatted text using a plain-text editor.
.xml eXtensible Markup Language A markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.
.json JavaScript Object Notation Open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of name–value pairs and arrays (or other serializable values).

Image files

Image file formats determine how pictures are saved and shown. Choosing the right format affects the file size, quality, and how well it works with different devices, especially for photography, websites, and design. Images can be stored as raster, or grids of pixels with specific properties, or as vectors where information is encoded as to how objects within the image should be drawn. Raster formats are most common for photos but suffer from degradation as they are enlarged. Vector formats are preferred when images are sparse but require sharp edges, such as plots and schematics. As the relative size of fonts and drawing objects scale with the figure and are redrawn before printing, vector graphics can be resized without much concern for losing content.

Raster image formats

Extension Full name Description
.jpg Joint Photographic Experts Group (version 1) A lossy compression format that is commonly used for photographs and other images with a lot of detail.
.png Portable Network Graphics A lossless compression format that is commonly used for images with sharp edges or text. Current standard for web images.
.gif Graphics Interchange Format The limited-color format is commonly used for animations and small images. Previous standard for web images.
.tif Tagged Image File Format High-quality format that is commonly used for professional photography and printing.
.bmp Bitmap An uncompressed format that is commonly used by Microsoft Windows.
.jp2 or .jpg2 Joint Photographic Experts Group 2000 (version 2) Update to jpeg to improve compression, security and other features. Still not as widely used as original despite its advances.
.heif or .heic High Efficiency Image File Developed in 2015 as a container to store digital images and image sequences. Adopted by Apple in 2017 and Android in 2019, but adoption is not consistent across platforms.
many Raw image format A camera raw image file is a file that contains unprocessed data straight from a digital camera. Such data can later be changed into a photo, either within a digital camera itself or by usage of external tools. Raw files are so named because they are not yet processed, and contain large amounts of potentially redundant data. Format and file extension depend on the camera model.

Vector image formats

Extension Full name Description
.eps or .epsi Encapsulated PostScript file A vector format that is commonly used for print graphics.
.svg Scalable Vector Graphics An XML-based, open standard for web graphics, offering small file sizes and excellent scalability.
.ai Adobe Illustrator Native format for Adobe Illustrator, widely used for professional digital and print design.
.pdf Portable Document Format Can contain both vector and raster data, excellent for document exchange and print.
.cdr CorelDRAW's native format Used for various design tasks like logos and fliers.
.wmf or .emf Windows Metafile formats Older formats for storing vector images.

Note

Many vector formats are used in GIS and CAD, so more will appear later in this document.

Audio files

Extension Full name Description
.mp3 MP3 Audio File Commonly used for storing and distributing music.
.wma Windows Media Audio Developed by Microsoft for audio compression, often used for streaming and downloading music.
.snd Sound A generic file extension for sound files, often associated with audio data.
.wav WAVE Audio File Commonly used for storing and recording audio.
.aac Advanced Audio Coding Used as an in-vogue sound field design for packed virtual sound and tune data.

Video files

Extension Full name Description
.mp4 MPEG-4 Video File Multimedia container format that commonly stores video and audio data.
.3gp 3GPP Multimedia File Multimedia container format that is commonly used for mobile phones.
.avi Audio Video Interleave File An older multimedia container format that is still supported by many devices.
.mpg MPEG Video File Older video compression format that is still supported by some devices.
.mov Apple QuickTime Movie The format that is commonly used by Apple devices.
.wmv Windows Media Video File The format that is commonly used by Microsoft devices.

Program files

Extension Full name Description
.c C/C++ Source Code File General-purpose programming language developed by Dennis Ritchie at Bell Labs between 1969 and 1972.
.cpp C++ source Code File A general-purpose programming language developed by Bjarne Stroustrup as an extension to the C programming language.
.java Java Source Code File Programming language created by Sun Microsystems that is now owned by Oracle Corporation.
.py Python script The programming language was developed by Guido van Rossum and first released in 1991.
.js JavaScript A scripting language that is primarily used to add interactivity to web pages.
.cs C# Source Code File A programming language developed by Microsoft as part of the .NET framework.
.pl Perl Script A programming language developed by Larry Wall at the University of California, Santa Cruz in the early 1980s.
.sh Bash Shell Script A shell scripting language commonly used to automate tasks on Unix-like operating systems
.bat Batch file Batch file format used to automate tasks on Windows systems; contains a series of commands to be executed by the command interpreter.
.com Command file A COM file is an executable file format used for programs on older Windows systems. COM files have limited functionality compared to modern formats.
.exe Executable file An executable file is a type of computer file that contains compiled code that can be run directly by the operating system. Executable files are commonly used to run programs.

GIS files

Vector Formats

Extension Full name Description
.shp, .shx, .dbf, .prj Shapefile The industry standard developed by Esri; it consists of multiple, mandatory files.
.geojson GeoJSON A lightweight format based on JSON, commonly used in web mapping applications.
.gpkg GeoPackage An open, standards-based, platform-independent format that stores data in a SQLite database.
.kml or .kmz Keyhole Markup Language XML-based format used for displaying geographic data in Google Earth and other web applications.
.gml Geography Markup Language XML-based open standard for spatial data exchange.
.dxf Autodesk DXF Data transfer format used for CAD data.
.sqlite Spatialite A spatial extension to SQLite, providing geodatabase functionality.

Raster Formats

Extension Full name Description
.tif or .tiff GeoTIFF A TIFF file with embedded geographic metadata.
.dem Digital Elevation Model Specifically for representing terrain elevation data.
.adf ArcInfo Grid A proprietary raster format from Esri composed of folders with .adf files.
.asc ArcInfo ASCII Grid A plain text (ASCII) file containing a header defining the grid and values for each pixel.

Meta data and other Formats

Extension Full name Description
.csv Comma Separated Variable Commonly used to store delimited, tabular data that may contain coordinates.
.tfw TIFF World File Companion file to a TIF, providing coordinate information, such as top-left corner and pixel size, often used in older, non-geotiff imagery.
.prj Projection file Defines the coordinate reference system (projection) for shapefiles.

Geodatabases (Hybrid/Comprehensive)

Extension Full name Description
.gdb File Geodatabase An Esri format storing datasets within a file system folder.
.sdf Spatial Data File A single-file, high-performance format developed by Autodesk.

Remote sensing data files

Remote sensing imagery will use many of the standard GIS data formats, but here are some additional formats used primarily in the remote sensing community and not as broadly in spatial sciences.

Imagery or raster files

Extension Full name Description
.bil Band Interleaved by Line (BIL) Method for organizing multi-band raster data in binary files. Pixel values are stored by line, so all bands for the current line appear before the next line starts.
.bip Band Interleaved by Pixel (BIP) Method for organizing multi-band raster data in binary files. Pixel values are stored by band, so all bands for the current pixel appear before the next pixel starts.
.bsq Band Sequential (BSQ) Method for organizing multi-band raster data in binary files. Band values are stored sequentially, so the entire image for the current band appears before the image of the next band starts.
.hdf .h4 .hdf4 .h5 .hdf5 Hierarchical Data Format (HDF4/HDF5) NASA standard for large, complex datasets, supporting multi-dimensional arrays, images, and tables.
.nc Network Common Data Form Widely used for multidimensional Earth science data like weather or ocean models.
.img ENVI image file A raw binary raster dataset commonly used in remote sensing, always accompanied by an ASCII text header file (.hdr) that defines file structure, dimensions, and data type. These files support BSQ, BIL, or BIP interleaving, and are designed to hold complex, multi-band geospatial raster data.
.ecw Enhanced Compression Wavelet (ECW) A proprietary wavelet compression image format used for aerial photography and satellite imagery. It was developed by Earth Resource Mapping, which is now owned by Intergraph, part of Hexagon AB. It is a lossy compression format for images best used for fast display of very large geospatial images.
.sid Multiresolution Seamless Image Database (MrSID) A file format developed and patented by LizardTech (in October 2018 absorbed into Extensis) for encoding of georeferenced raster graphics, such as orthophotos. Best for distributing and storing very large geospatial image files requiring high-compression while preserving high-quality.

Other remote sensing data

Extension Full name Description
.las LiDAR Aerial Survey (LAS) Uncompressed binary standard for 3D point cloud data, storing X, Y, Z coordinates, intensity, and classification.
.laz LASzip Losslessly compressed version of the LAS format, reducing file size by up to 90%.

Metadata files

Extension Full name Description
.hdr Header file Typically stores image dimensions and geolocation information for older, binary image file formats such as the ENVI .img file as well as images stored as BIL, BIP or BSQ

Scientific data formats

Descriptions of Common Scientific Data Formats. Note that these are generally self-describing (so metadata is contained within the file), with some caveats. Additionally, there are typically tools developed to work with and explore data in these formats developed for specific communities (climate, weather, oceanography, remote sensing), which are not explored here but may be worth an extra look if you are going to make regular use of data in these formats.

Tutorials for Working with Common Scientific Formats in Python