What is layer file (*.lyr) in ArcGIS Desktop?

Geographic data tell you how to paint by numbers:

Figure 1

A layer file tells what colors (etc.) go with the numbers:

Figure 2

When both are available, the GIS puts them together into a map:

FoxTrot panel


To understand what a layer file is, you need to understand what a layer is (this discussion is very relevant for that: What's the difference between feature class and feature layer?).

A layer (.lyr) file is simply a persistent (file-based) representation of a layer.

Neither contain any actual geographic data, only a reference to the data along with some properties about how to render it (properties for symbology, labeling, etc.).

One thing to be aware of is that if your layer references a database connection that that connection information is stored in the layer file. This can be a very bad thing from a security standpoint. Passing user login credentials around in layer files should be avoided. To avoid storing user names and passwords in layer files, the "Save username and password" box should be unchecked before using an SDE database connection file. See "Connecting to a database" for more information.


A layer (.lyr) file has mainly two important functions:

  1. It contains a link or a pointer to the location of the Data.

  2. It contains information on how to render or draw the Data.

One of my colleague always explained it as follws: A .lyr file is like a Business/Visiting Card. It tells you (or rather ArcGIS) where to find the Data. And how to Address and interact (in this case Render) with it.