A PCD file (Point Cloud Data) is the native file format of the Point Cloud Library, PCL. A short text header says what each point holds and how the points are stored; the points follow, as text or as binary. Here is the start of one, a city block saved by Open3D:
# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS x y z rgb
SIZE 4 4 4 4
TYPE F F F F
COUNT 1 1 1 1
WIDTH 158098
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 158098
DATA ascii
149.1999969 12.68000031 42.38000107 1.30935689e-38
145.8600006 13.02000046 56.84000015 1.751679833e-38Two things in those last lines are worth a second look. The first coordinate was 149.2 before it was saved: stored as a 32-bit float it becomes 149.1999969, and printed in full that is what appears. And the fourth number, 1.3 × 10-38, is a colour — red 142, green 147, blue 139 — packed into the bits of a float, which the section on colour below explains.

Where PCD files come from
- PCL itself. Any program built on PCL saves and loads clouds with
pcl::io::savePCDFileandloadPCDFile. - ROS. The
pcl_rospackage has tools that write point cloud messages from a running robot or a recorded bag to PCD files. - SLAM. LiDAR SLAM packages such as LIO-SAM and FAST-LIO save the maps they build as PCD.
- Depth cameras. Kinect, RealSense and similar cameras, captured through PCL or ROS, give organized PCD frames.
- General tools. Open3D and PDAL read and write PCD, so it also turns up as an exchange format between them.
The header, line by line
The keywords come in this order in files PCL writes. Older files (versions 0.5 and 0.6) leave some out, and readers fill those in with PCL's defaults.
| Keyword | What it says |
|---|---|
VERSION | The format version, 0.7 for everything written in the last decade. |
FIELDS | The name of each field: x y z, rgb, intensity, normal_x, and so on. PCL's padding bytes appear as _. |
SIZE | Bytes per value for each field: 1, 2, 4 or 8. |
TYPE | F for floating point, I for signed and U for unsigned integers. |
COUNT | Values per field, usually 1. Descriptors such as a 33-bin FPFH histogram have more. Defaults to 1. |
WIDTH, HEIGHT | The shape of the cloud. HEIGHT 1 is an unorganized list; anything more is a grid, row by row. |
VIEWPOINT | Where the sensor was: a position, then an orientation as a quaternion (w x y z). Defaults to 0 0 0 1 0 0 0. |
POINTS | The number of points, WIDTH × HEIGHT. |
DATA | How the points are stored: ascii, binary or binary_compressed. |
Three ways to store the points
The same 158,098 points with colour, measured in each encoding, with the LAZ file the block was cut from for comparison:
| Stored as | Size | Bytes per point |
|---|---|---|
| PCD, ascii | 8.06 MB | 51 |
| PCD, binary | 2.53 MB | 16 |
| PCD, binary_compressed | 2.04 MB | 13 |
| LAZ, with intensity, returns, classification and GPS time too | 1.38 MB | 9 |
- ascii is one point per line, values separated by spaces. Easy to inspect, slow to read, and several times the size of the binary forms. Missing points are written as
nan. - binary is the points as fixed-size records, one after another, exactly as they sat in PCL's memory — including padding, which is what the
_fields in some headers account for. Values are in the byte order of the machine that wrote them, which in practice is always little-endian. - binary_compressed starts with two 4-byte numbers, the compressed and uncompressed sizes, then one LZF-compressed block. Before compressing, PCL regroups the values field by field — every x, then every y, then every z — because values of the same kind side by side compress far better than mixed records. Padding is left out.
The compressed form has a cost for readers: it cannot be sliced. Record one million of a binary file is at a computable offset; in a compressed file it is somewhere in an LZF stream that has to be decoded from the start, and its x, y and z are in three different places.
Organized clouds
When HEIGHT is more than 1, the cloud is organized: a grid of WIDTH × HEIGHT points that keeps the layout of the sensor. A Kinect frame is 640 × 480, one point per depth pixel; a spinning LiDAR's scan can be stored as beams × firings. Algorithms use the grid to find neighbours without a search.
Every slot is kept, including the pixels where the sensor saw nothing, and those hold NaN coordinates. In four Kinect frames of an office, 640 × 480 each, between 15 and 37 per cent of the 307,200 points are NaN. A reader has to leave them out, or it draws a cluster of points at the origin.
Organized clouds from cameras also come in the camera's optical frame: X to the right, Y down, Z straight ahead. A viewer that assumes Z is up shows the room lying on its back.
Colour, packed into a float
PCL's point types with colour store it in one four-byte field, rgb, with red, green and blue in the low three bytes and alpha, in rgba, in the top one. The field is usually declared TYPE F, a float — so its value as a number means nothing, and a reader has to take its bits. In a text file there are two ways to print those bits:
- as the float, the way Open3D and older PCL do:
1.30935689e-38; - as an unsigned integer, the way current PCL does:
4287533963. PCL switched because with the alpha byte set, many colours are NaN as floats and would be lost in text.
Not every writer packs. PDAL writes red green blue as separate 8-byte floats holding 16-bit LAS colour; other tools write r g b as 0–1 floats or 0–255 integers. The header gives only the storage type, so the scale has to be found from the values themselves.
What a PCD file does not hold
- Units and a coordinate system. There is no field for either. Robotics data is in metres by ROS convention and in a local frame — the sensor's, the robot's or the map's — not in a projection.
- Precision to spare. Coordinates are almost always 32-bit floats. Near the origin that is far finer than any sensor; at 150 km from it, the gap between neighbouring float values is about 1.6 cm. Survey coordinates therefore do not belong in a float PCD without being shifted first.
- A transform from the viewpoint.
VIEWPOINTrecords where the sensor was. PCL does not move the points by it, and a reader should not either unless it knows the points were saved in the sensor's own coordinates. - Standard meanings. A field called
labelorintensitymeans what the writer meant; nothing defines its range. Compare LAS classification codes, which are fixed by the specification.
Not to be confused with Photo CD
Kodak's Photo CD, from the 1990s, stored scanned photographs as .pcd files too, several resolutions of one image in each. They have nothing in common with point clouds but the extension. A point cloud PCD shows readable keywords — VERSION, FIELDS — in a text editor; a Photo CD image has no such header, only binary image data.
Working with a PCD file here
Open it in the PCD viewer — ASCII, binary and binary_compressed, organized clouds with their NaN pixels left out and counted, packed colour in either text form, and an Up control for camera frames. The panel lists every field in the header with what it was used for. It runs in the browser and nothing is uploaded.
For the neighbouring formats, what is a LAS file covers the survey side, and what is an XYZ file the plain-text one. PLY, the other header-plus-records format, opens in the PLY viewer.