Hex Color Picker

Visual to digital. This script captures changes from a color picker input and displays the resulting Hexadecimal code instantly.

Copy the Script

<input type="color" oninput="showHex(this.value)">
<span id="hexCode"></span>

<script>
function showHex(color) {
    document.getElementById("hexCode").innerText = color;
}
</script>

Frequently Asked Questions

Yes. The `` tag triggers the native OS color picker on both Android and iOS, which is very user-friendly.

Yes. You would need a JavaScript helper function to parse the hex string (`#RRGGBB`) into three separate integers (0-255).

Yes. Just set the `value` attribute: ``.