---
title: "What is a hash function?"
term: "Hash function"
description: "A hash function is an algorithm that converts data of any size into a fixed-size value, called a hash, so that the same input always produces the same output."
url: "https://glossary.io/hash-function/"
published: "2026-11-22T20:37:06.757Z"
updated: "2026-11-22T20:37:06.757Z"
aliases:
  - "Hash algorithm"
topics:
  - "Privacy and security"
wikidata: "https://www.wikidata.org/wiki/Q183427"
---

# What is a hash function?

**Definition:** A hash function is an algorithm that converts data of any size into a fixed-size value, called a hash, so that the same input always produces the same output.

**Also known as:** Hash algorithm

Hash functions are used to look up data quickly in hash tables, check files for corruption and detect duplicate content. Cryptographic hash functions such as [SHA-256](https://glossary.io/sha-256/) add stronger guarantees: it's practically impossible to work backward from a hash to the input or to find two inputs with the same hash, which makes them useful for digital signatures, TLS certificates and verifying downloads.

On the web, hashing also helps protect privacy. Some analytics tools, such as [Fathom Analytics](https://glossary.io/fathom-analytics/), combine details like a visitor's IP address and browser with a regularly changing salt and hash them, so they can count unique visitors without storing identifying data. Passwords should be stored with slow, salted hashing algorithms designed for that purpose, because fast or unsalted hashes can be cracked with precomputed [rainbow tables](https://glossary.io/rainbow-table/).

## Hash function resources

- [Hash function on Wikipedia](https://en.wikipedia.org/wiki/Hash_function)

## Related terms

- [rainbow table](https://glossary.io/rainbow-table/)
- [SHA-256](https://glossary.io/sha-256/)
- [Fathom Analytics](https://glossary.io/fathom-analytics/)
- [Gravatar](https://glossary.io/gravatar/)

**Topic:** [Privacy and security](https://glossary.io/topics/privacy-security/)

## Cite this definition

- APA: What is a hash function? (2026, November 22). Glossary. https://glossary.io/hash-function/
- MLA: “What Is a Hash Function?” Glossary, Coywolf, 22 Nov. 2026, glossary.io/hash-function/.
- Chicago: “What Is a Hash Function?” Glossary. Coywolf. November 22, 2026. https://glossary.io/hash-function/.

Published November 22, 2026.
