.RDS

RDS File

R Data Serialization File
Ask a question
QUICK ANSWER

An RDS file is an R Data Serialization file - the R statistical language saves a single object (data frame, model, list, vector) to disk with saveRDS(), and reads it back with readRDS("file.rds"). Open it with R or RStudio. It cannot be opened in a spreadsheet or text editor without first extracting the data through R or Python.

Developer: R Core Team (R Foundation for Statistical Computing) Category: Data Files Open standard MIME: application/octet-stream
OPENS ON Windows macOS Linux Web
Related: .PKPASS · .DAT · .JSON · .RIS

On this page

19k+ extensions indexed
Last reviewed Aug 9, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the RDS file format?

An .rds file is an R Data Serialization file produced by R's saveRDS() function. It stores exactly one R object - a data frame, list, model, vector, or any other R structure - in R's native binary serialization format. Unlike .RData files created by save(), which restore named objects directly into the global environment, .rds files are loaded with readRDS() and returned as a value that the caller can assign to any variable name.

By default, the serialized data is wrapped in gzip compression, so most .rds files open as gzip streams if not handled as R objects (magic bytes 1F 8B). Compression can also be set to bzip2, xz, or disabled entirely with saveRDS(obj, file, compress = FALSE).

R supports two serialization format versions: version 2 (R 1.4-3.4, default before R 3.5.0) and version 3 (default since R 3.5.0, released April 2018), which adds explicit encoding metadata for character strings - important for non-ASCII text. File sizes range from a few kilobytes for small vectors to several gigabytes for large data frames or complex models.

.rds files are the standard unit of R object persistence: analysts use them to cache intermediate results, share trained model objects, and store processed data between sessions. For interoperable columnar data shared across tools, formats such as .parquet are increasingly preferred; .rds remains the go-to choice whenever the consumer is always R.

Security & safety

RISK: MEDIUM

RDS files can embed arbitrary R code via closures, S4 methods, or R5/R6 class environments. readRDS() evaluates promises and active bindings on access. Do not open .rds files from untrusted sources in R, as maliciously crafted objects could execute code during deserialization. The R Core Team has noted this risk in the documentation.

Format details

in a nutshell
FULL NAMER Data Serialization Fileaka RDS file, R serialized object
DEVELOPERR Core Team (R Foundation for Statistical Computing)since 2001 (R 1.4.0, saveRDS/readRDS introduced)
CATEGORYData Files
MIME TYPEapplication/octet-stream
TYPEbinary serialized R object (optionally compressed)
STANDARDOpen · royalty-free
This extension is also used by…
  • Ray Dream Studio Scene File - Legacy 1990s 3D animation format by Ray Dream Inc. / MetaCreations (later Carrara/DAZ); binary with magic 'RD ' (0x33 0x44 0x43 0x20 in hex '3DC '); software is abandoned, files unreadable by modern tools.
MAGIC BYTES · FILE SIGNATURE
OFFSET
0001
HEX
580A
ASCII
X·
Uncompressed RDS begins with 'X\n' (0x58 0x0A) for XDR format or 'A\n' (0x41 0x0A) for ASCII format. When gzip-compressed (default): bytes 0-1 = 1F 8B (gzip magic); when xz-compressed: FD 37 7A 58 5A 00. In practice most .rds files start with 1F 8B (gzip).

Programs that open RDS files

Windows2 apps
R (base) Open-source readRDS('path/to/file.rds') - returns the stored object.
RStudio Desktop Free Click the .rds file in the Files pane, or run readRDS() in console.
macOS2 apps
R (base) Open-source readRDS('file.rds') in R console or script.
RStudio Desktop Free Use Files pane or readRDS() in console.
Linux3 apps
R (base) Open-source readRDS('file.rds') - available from any R installation.
RStudio Desktop / Posit Workbench Free IDE; open .rds via Files pane or readRDS() command.
Python + rpy2 Open-source import rpy2.robjects as ro; obj = ro.r'readRDS' - converts RDS to Python R objects.
Web1 app
Posit Cloud (RStudio in browser) Freemium Upload .rds, then readRDS() in console - no local R install needed.

Technical details

deep spec
EncodingBinary (gzip-compressed by default); bzip2, xz, or uncompressed variants also supported
Objects storedExactly one R object per file - any SEXP type: vector, list, data.frame, model, environment reference, etc.
Serialization format versionVersion 2 (R 1.4-3.4) or version 3 (R 3.5+, default since 2018); version number stored in stream header
Default compressiongzip (compress=TRUE); alternatives: bzip2, xz, or none (compress=FALSE)
Magic bytes1F 8B (gzip header, compressed); 58 0A (XDR uncompressed); 41 0A (ASCII uncompressed)
Byte orderBig-endian XDR (External Data Representation) for the raw serialization stream; compression wrapper is platform-independent
Serialization scopeSingle R object (contrast with .RData which stores one or more named objects restored into the calling environment)
Character encoding metadataVersion 3 format embeds explicit encoding metadata for character strings, enabling correct handling of non-ASCII content
Typical file sizeA few KB (small vectors) to several GB (large data frames, trained machine-learning models)
Read/write functionsreadRDS() returns the object as a value; saveRDS() writes it - caller assigns any variable name on load
Platform compatibilityCross-platform; Windows, Linux, and macOS produce identical serialization streams
Compression verificationInspect magic bytes with a hex editor; or use R's gzcon() / file() connection functions to confirm gzip wrapping
Released2001 (R 1.4.0, saveRDS/readRDS introduced)
Latest versionSerialization format version 3 (R 3.5.0, 2018)
Open standardYes · royalty-free
Specificationstat.ethz.ch

RDS conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with RDS files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about RDS files.

Frequently asked questions

How do I open an RDS file?
In R: mydata <- readRDS('file.rds'). In RStudio, click the file in the Files pane. For Python: use the rpy2 package.
What does an RDS file contain?
Exactly one R object - could be a data frame, a trained model, a list, a vector, or any other R data structure.
Can I open an RDS file without R?
Not directly. Python can read it via rpy2. There is no standalone viewer. If it's tabular data, ask the creator to also provide a CSV or Parquet.
What is the difference between .rds and .RData/.rda?
.rds stores one unnamed object (caller assigns the name on load). .RData/.rda stores one or more named objects that are loaded directly into the R environment.
Is an RDS file the same as a Ray Dream 3D file?
No. Ray Dream Studio (1990s 3D software) also used .rds but that software is long abandoned. Today virtually all .rds files you encounter are R language serialization files.
Can I convert an RDS file to CSV?
Yes, if it contains a data frame: write.csv(readRDS('file.rds'), 'out.csv') in R. For complex objects, you need to extract the tabular parts manually first.

References

1Archive Team - Ray Dream (historical 3D format info)justsolve.archiveteam.org
2R documentation - readRDS / saveRDSstat.ethz.ch

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.EXEWindows Executable (Portable Executable)
6.NOMEDIAAndroid No-Media Marker File
7.RPMSGRestricted Permission Message
8.MDMarkdown Document
9.TMPTemporary File
10.BINCD/DVD Disc Image (BIN/CUE)

Related extensions

.PKPASSApple Wallet Pass (formerly Passbook)
.DATProgram Data File (generic)
.JSONJavaScript Object Notation file
.RISResearch Information Systems citation file
.OFXOpen Financial Exchange
.CSVComma-Separated Values

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z