Lee este artículo en español.
How to Hash Text in n8n (MD5, SHA-256, SHA-512) for Free
Updated
Short answer: Use the built-in Crypto node. Add it to your flow, choose the action Hash and pick the Type (for example SHA256). You can also use the expression
{{ $json.text.hash('sha256') }}. Both are free and you don't need an API for this.
A hash is a short fingerprint of a text or a file. You use it to check that something has not changed, to spot duplicate records, or to shorten long content into a key. n8n can calculate hashes on its own, so you don't need any extra service.
The free way: Crypto node
- Add a Crypto node after the node that has your text (for example a trigger or a Set node).
- Set the action to Hash.
- In Type, choose the algorithm: MD5, SHA256, SHA3-256, SHA3-384, SHA3-512, SHA384 or SHA512.
- In Encoding, choose HEX or BASE64.
- In Value, write the text to hash, for example
{{ $json.content }}. - In Property Name, write
hash. The result goes to{{ $json.hash }}.
The node works item by item: each item gets its own hash.
For example, the text hello world with SHA256 and HEX gives b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9.
Note: the Crypto node does not offer SHA-1. If you need SHA-1, use the expression below.
Hashing a file
To hash a file, turn on Binary File and enter the Binary Property Name, which is the name of the field that holds the file.
Example: only process records that changed
- A trigger with the record's content.
- A Crypto node (action Hash, Type SHA256, Encoding HEX) that computes its hash.
- An If node that compares
{{ $json.hash }}with the hash saved last time (in a database or Google Sheets). If they are different, the flow continues. If they are the same, it stops.
Only content that actually changed gets reprocessed.
Another free way: the hash() expression
In any field that accepts expressions, you can write:
{{ $json.text.hash('sha256') }}
The function works on a string. If you leave out the algorithm, it uses md5. The algorithms are: md5, base64, sha1, sha224, sha256, sha384, sha512, sha3 and ripemd160. Unlike the Crypto node, it includes SHA-1.
When the Cofferdock API is worth it
- The same call in all your tools. The same request works from n8n, Make, Zapier or your own code.
- SHA-1 without expressions. The Crypto node does not have SHA-1. The Cofferdock API does.
If you only need a hash in n8n, the Crypto node is the better option: it is free, built in and needs no key. The API only makes sense when one of the reasons above applies to you.
What you'll get
You send a text and the algorithm you want (md5, sha1, sha256 or sha512) and get back the hash, in hex or base64.
Common uses in n8n:
- Checking whether a record's content has changed since last time by comparing its hash.
- Deduplicating rows coming from different sources without comparing the full text.
- Generating a short, stable fingerprint of long content, to use as a key.
- Signing a value before sending it to a webhook that verifies it.
What you need
- A Cofferdock account. The free tier gives you 50 uses/month with no card.
- Your API key, from your dashboard with "+ Create key". It's shown only once.
- An HTTP Request node in your n8n flow.
Step by step in the HTTP Request node
Add an HTTP Request node and fill it in like this:
- Method:
POST - URL:
https://api.cofferdock.com/hash - Send Headers: turn it on and add two:
x-api-keywith your key, andContent-Typewith the valueapplication/json. - Send Body: turn it on → Body Content Type:
JSON→ in the body:
{ "text": "={{ $json.content }}", "algorithm": "sha256" }
- Under Options → Response → Response Format leave it as JSON.
The response includes hash and algorithm, ready to use with {{ $json.hash }}.
Options you can tweak
Add them in the same JSON body:
| Option | Default | What it does |
|---|---|---|
algorithm | sha256 | md5, sha1, sha256 or sha512. |
encoding | hex | hex or base64. |
Prefer to see it in code?
The same call with curl:
curl -X POST "https://api.cofferdock.com/hash" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "hello world", "algorithm": "sha256"}'
How much does it cost?
Each call uses 1 credit from your plan, whatever the algorithm or the size of the text. Every Cofferdock tool draws from the same pool of credits.
FAQ
Does n8n have a native node to generate hashes? Yes. The Crypto node has a Hash action (n8n docs). It is free and needs no account or key. You can also use the hash() expression (n8n docs), for example {{ $json.text.hash('sha256') }}.
Can I hash a file, not just text? Yes. In the Crypto node, turn on Binary File and enter the Binary Property Name. The Cofferdock API also accepts raw binary bytes directly (Content-Type application/octet-stream).
Which algorithm should I use? sha256 for most cases (checksums, deduplication). md5 only if you need compatibility with an old system that requires it.
Does the same text always produce the same hash? Yes, a hash is deterministic: the same text and algorithm always produce the same result.
Related guides
Try it yourself
You'll find the full instructions, with copy-paste examples, on the hash generator page. And if you don't have an account yet, you can create one for free and build your first flow today.