Raster Calculator Simulator & Guide for ArcGIS | Complete Tutorial


how to use raster calculator in arcgis

Interactive Raster Calculator Simulator

This tool simulates the cell-by-cell logic of the ArcGIS Raster Calculator. Enter numerical values for two rasters and an algebraic expression to see the result.


Enter numbers separated by commas for columns and new lines for rows.


Must have the same dimensions as Raster A for most operations.


Use raster names in double quotes (e.g., "RasterA" * 10). Supported functions: Con(cond, true_val, false_val), Sin(), Cos(), Pow().


Calculation Results

Your output raster will appear here.

Results copied to clipboard!

What is the Raster Calculator?

The Raster Calculator is one of the most powerful tools within the ArcGIS Spatial Analyst extension. It allows you to perform complex mathematical calculations on a cell-by-cell basis using one or more raster datasets. This process, known as map algebra, is fundamental to geospatial analysis, enabling you to create new datasets that derive meaning from existing ones. Anyone wondering how to use raster calculator in arcgis will find that it’s the key to unlocking custom spatial models and analyses.

You can use it for everything from simple arithmetic (adding two elevation rasters) to complex algebraic and conditional expressions for site suitability modeling. The key misunderstanding is that it’s just a simple calculator; in reality, it’s a complete language for raster processing.

Raster Calculator Formula and Explanation

The core of the Raster Calculator is its expression-based syntax. You combine raster layers (referred to by their name in double quotes), numbers, and mathematical operators/functions to create an output raster. For every cell in the output grid, the tool performs the calculation using the corresponding cell values from the input rasters.

For example, the expression "Elevation" * 3.28 would convert an elevation raster from meters to feet. Learning these map algebra expressions is crucial for effective analysis.

Common Operators and Functions

Commonly used variables and functions in the Raster Calculator
Operator/Function Meaning Example Expression Unit Impact
+, -, *, / Standard arithmetic operators for cell-by-cell math. "RasterA" + 10 Units must be compatible (e.g., adding two elevation rasters).
Con(condition, true_exp, false_exp) Conditional tool. If the condition is true for a cell, it gets the true expression value; otherwise, it gets the false expression value. Con("Elevation" > 1000, 1, 0) Output units are determined by the true/false expressions.
Sin(), Cos(), Tan() Trigonometric functions. Inputs are typically assumed to be in radians. Sin("Aspect_Raster") Input is unitless (angle), output is a unitless ratio.
Pow(in_raster, power) Raises cell values to the specified power. Pow("Distance_Grid", 2) Alters units exponentially (e.g., meters become square meters).
IsNull(in_raster) Identifies cells with NoData values. Returns 1 for NoData cells and 0 for valid cells. IsNull("Land_Cover") Output is a unitless binary raster (0 or 1).

Practical Examples

Example 1: Calculating NDVI (Normalized Difference Vegetation Index)

NDVI is a common index used to measure vegetation health. It requires Near-Infrared (NIR) and Red light bands as input rasters.

  • Inputs: A “NIR” raster and a “Red” raster.
  • Formula: Float("NIR" - "Red") / Float("NIR" + "Red")
  • Units: Input units are reflectance (unitless ratio). The output is also a unitless ratio, typically ranging from -1 to +1.
  • Result: A new raster where higher values indicate healthier vegetation. Using Float() ensures the division results in a floating-point output, which is crucial for this type of index calculation. Our NDVI calculator can help you explore this further.

Example 2: Site Suitability with the Conditional Tool

Imagine we need to find areas that are suitable for a new park. The criteria are: elevation below 500 meters and slope less than 10 degrees.

  • Inputs: An “Elevation” raster and a “Slope” raster.
  • Formula: Con(("Elevation" < 500) & ("Slope" < 10), 1, 0)
  • Units: Elevation in meters, Slope in degrees. The output is a binary raster (unitless).
  • Result: An output raster where cells with a value of 1 represent suitable locations and cells with a value of 0 are unsuitable. This is a foundational step in many raster analysis techniques.

How to Use This Raster Calculator Simulator

This interactive tool helps you understand the cell-by-cell logic of map algebra before you even open ArcGIS.

  1. Enter Input Data: In the "Input Raster A" and "Input Raster B" text areas, provide simple grids of numbers. Each number represents a cell value. Make sure the dimensions (rows and columns) match.
  2. Write Your Expression: In the "Map Algebra Expression" box, write a formula using "RasterA" and "RasterB" as your layer names.
  3. Calculate: Click the "Calculate Output Raster" button. The simulator will perform your calculation on each pair of corresponding cells.
  4. Interpret the Results: The "Calculation Results" section will display the final output raster as a grid. It will also provide a breakdown of the calculation for the first cell, helping you understand how the tool arrived at its result. This is a great way to learn before diving into ArcGIS Pro raster functions.

Key Factors That Affect Raster Calculations

  • Cell Size: Input rasters should have the same cell size for accurate analysis. If they don't, ArcGIS will resample one of them based on your geoprocessing environment settings.
  • Raster Extent: The analysis will only be performed on the area where the input rasters overlap.
  • NoData Values: Cells with a "NoData" value are typically ignored in calculations. If a cell in any input raster is NoData, the corresponding output cell will also be NoData.
  • Data Type (Integer vs. Floating Point): An integer raster can only store whole numbers, while a floating-point raster can store decimals. Dividing two integer rasters might result in a truncated integer output. To ensure decimal precision, convert at least one input to float, e.g., Float("IntRaster1") / "IntRaster2".
  • Coordinate System: While the Raster Calculator itself doesn't reproject data on the fly, all your inputs should be in the same coordinate system for the analysis to be spatially meaningful. Understanding coordinate systems is vital.
  • Syntax: The syntax for raster names (double quotes), strings (single quotes), and functions is strict. A misplaced quote or parenthesis is a common source of errors.

Frequently Asked Questions (FAQ)

1. Why do I get a generic "ERROR 999999"?
This is a general error in ArcGIS. For the Raster Calculator, it's often caused by a syntax error in your expression, a mismatch in raster dimensions, or data type issues. Double-check your quotes and function names.
2. How do I handle NoData in my calculations?
Use the `IsNull()` or `Con(IsNull())` functions. For example, to replace NoData values in "RasterA" with 0, you could use: Con(IsNull("RasterA"), 0, "RasterA").
3. What's the difference between using `&` and "and"?
In the Raster Calculator, & is the bitwise AND operator and works on a cell-by-cell basis. The keyword "and" is a logical operator and may not always work as expected in older versions. Always use the symbols (& for AND, | for OR, ~ for NOT).
4. Can I use Python in the Raster Calculator?
Yes, the ArcGIS Pro Raster Calculator tool allows you to use Python syntax and functions from the `arcpy.sa` module, which offers more power and flexibility. This simulator uses the older, simpler map algebra syntax.
5. How do I refer to raster layers with spaces in their names?
Always enclose the raster layer name in double quotes, exactly as it appears in the table of contents, e.g., "My Elevation Data" * 3.28.
6. What is the most common use case for the Raster Calculator?
The most frequent use is suitability modeling using the Con() tool, along with creating custom indices like NDVI. It is the go-to tool for any custom analysis that isn't covered by a pre-built tool.
7. What does the "Float()" function do?
It temporarily converts the raster values to a floating-point data type for the purpose of the calculation. This is essential to prevent integer division, where decimals are truncated (e.g., 5 / 2 would result in 2, not 2.5).
8. How is this different from the ArcGIS Spatial Analyst toolbar?
The Raster Calculator is a single, powerful tool within the Spatial Analyst toolbox. The toolbox contains many other specialized tools (like Slope, Aspect, Hillshade), but the calculator provides the most flexibility for custom expressions.

Related Tools and Internal Resources

Explore these resources to deepen your understanding of raster analysis and ArcGIS:

© 2026 Geo-Analysis Tools Inc. All rights reserved.


Leave a Reply

Your email address will not be published. Required fields are marked *