SHA256 hash

SHA256 encoded string


Usage FAQ

Usage from Address Bar

You can use direct access to this page from your browser address bar. Type string that you need to encode with algorithm according to next schema:<ALGORITHM>/<PHRASE> For example to visit page that contains hash of "hello world" you can just visit url: The another cool thing is that you can specify "json" or "plain" mode into URL and you will get only HASH in response. Schema of this future:<ALGORITHM>.<OUTPUT:plain|json>/<PHRASE> Example: Will output only: "5eb63bbbe01eeed093cb22bb8f5acdc3"

If you have string that contains complicated urlencoded characters you can send it directly via params to avoid processing of our url parser. Use:
str - for string to encode
algo - for algorithm
output - for output type (empty, "json" or "plain")<ALGORITHM>&str=<PHRASE>&output=<OUTPUT:plain|json>

Usage from Javascript

We have removed CORS restriction so you can use direct access to hash calculator in your javascript applications via AJAX.


var toEncode = 'hello world';
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
console.log('JSON of "'+toEncode+'" is "'+JSON.parse(xhr.response)+'"');
};'GET', ''+encodeURIComponent(toEncode), true);
Will output: JSON of "hello world" is "5eb63bbbe01eeed093cb22bb8f5acdc3"

Usage from PHP

You can use direct access to hash in your applications.

PHP Example: <?php
$str = 'hello world';
$url =''.urlencode($str);
$md5hash = file_get_contents($url);
echo 'Hash of "'.$str.'" is "'.$md5hash.'"';
Will output: Hash of "hello world" is "5eb63bbbe01eeed093cb22bb8f5acdc3"

Chains of algorithms

In some cases you can need encode string with two or more algorithms. For these cases we have introduced chains of algorithms. For example if you need to encode string according to this schema md5(sha512(sha1('hello world'))) you can do this by connecting algorithms with a double dash: If you will do this in your address bar you can also use semicolon instead of double dash.;sha512;sha1/hello+world Pay attention that semicolon should be encoded in url, so if you use it not in your browser, you should use '%3B' instead Such approach can be also used with "plain" and "json" mode;sha512;sha1.json/hello+world

You can also use special chain item "b64d" or "base64decode" to make base64 decode. It can help to hash any of not printable characters. Example: will be the same: 5eb63bbbe01eeed093cb22bb8f5acdc3

Carriage Return and Line Feed characters

At present time our text editor doesn't have functionality that can take into account which of those characters you want to keep in string. This problem come from browsers which normalize all of the line endings to "CRLF" ("\r\n") format according to "HTML specification". It means that if you paste from buffer string
"hello\nword" and press "Encode", your browser will convert it to "hello\r\nword" and only after this your browser send FORM to us. As a result we will show you hash of "hello\r\nword" but not "hello\nword"

You can avoid this with encode string to "base64" on your side and use "Chains of algorithms" that described above.

Example 1: Hash from string with only Line Feed (LF) character Text: hello\nworld
Text encoded to BASE64: aGVsbG8Kd29ybGQ=
RESULT: 9195d0beb2a889e1be05ed6bb1954837

Example 2: Hash from string with Carriage Return (CR) and Line Feed (LF) character. This result you will have if you use editor with CR, LF or CRLF symbols.
Text: hello\r\nworld
Text encoded to BASE64: aGVsbG8NCndvcmxk
RESULT: 6a4316b18e6162cf9fcfa435c8eb74c1

How to calculate sha256 hash in PHP with hash function

Since version 5.1.2 PHP contains function hash() that you can use to get sha256 hash from strings.

    $str = '¡Hola!';
    $hash = hash('sha256', $str, false);
    echo '<pre>';
    echo $str.PHP_EOL
         .' &rarr; '.$hash.PHP_EOL
    echo '</pre>';
Please read the privacy policy (agreement of the cookies usage, other websites embedded content, etc.). If you continue to use the site, we will assume that you agree with our privacy policy.
OkPrivacy Policy