---
schema_version: "1"
id: 6480223f6e1366d2fbb9be2e77d9a726db2de2213505c4f4d61cb7092e7242c0
title: CASESAFEID
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/customize_functions_casesafeid.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.customize_functions_casesafeid.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e03d1b45348e92f80178cfcb9f67d9ab0c6dc287906d0e8322518bc70b9928ae
description: Converts a 15-character ID to a case-insensitive 18-character ID. In Salesforce Classic, the function converts only valid Salesforce 15-character IDs. If you pass in an invalid ID, the function returns the ID passed in. In Lightning Experience, the function converts any 15-character ID.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# CASESAFEID

Converts a 15-character ID to a case-insensitive 18-character ID. In Salesforce Classic, the function converts only valid Salesforce 15-character IDs. If you pass in an invalid ID, the function returns the ID passed in. In Lightning Experience, the function converts any 15-character ID.

## Use

`CASESAFEID(id)` and replace id with the object’s ID.

## Tips

- Convert to 18-character IDs for better compatibility with Excel.
- The CASESAFEID function is available everywhere that you can define a formula except reports and s-controls.
- If you’re using Lightning Experience, and you want the function to convert only valid 15-character IDs, contact Salesforce Customer Support to enable this functionality.

![Formula Example in Salesforce Classic](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

Formula Example in Salesforce Classic

```
CASESAFEID (Id)
```

This formula replaces the 15-character ID with the 18-character, case-insensitive ID.

- `CASESAFEID('A01xx000003DHur')` returns `A01xx000003DHur`. The ID isn’t valid because it begins with a capital letter.
- `CASESAFEID('001xx000003DHur')` returns something like `001xx000003DHurAAG` because the ID passed in is valid.