Questions tagged [hex]

Hexadecimal (also base 16, or hex) is the base-16 positional numeral system, using the 16 symbols 0–9 and A‒F.

Hexadecimal (also base 16, or hex) is a numeral system with a base of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a–f) to represent values ten to fifteen.

Each hexadecimal digit represents four binary digits (bits), and the primary use of hexadecimal notation is a human-friendly representation of binary-coded values in computing and digital electronics. More information may be found here.

Other numeral systems:

8814 questions
1643
votes
29 answers

How to convert decimal to hexadecimal in JavaScript

How do you convert decimal values to their hexadecimal equivalent in JavaScript?
Luke Smith
  • 20,674
  • 7
  • 27
  • 28
1460
votes
48 answers

How do you convert a byte array to a hexadecimal string, and vice versa?

How can you convert a byte array to a hexadecimal string, and vice versa?
alextansc
  • 4,506
  • 6
  • 25
  • 45
1350
votes
10 answers

Hex transparency in colors

I'm working on implementing a widget transparency option for my app widget although I'm having some trouble getting the hex color values right. Being completely new to hex color transparency I searched around a bit although I couldn't find a…
SweSnow
  • 16,324
  • 9
  • 32
  • 49
853
votes
12 answers

Convert hex string to int in Python

How do I convert a hex string to an int in Python? I may have it as "0xffff" or just "ffff".
Matt
  • 72,111
  • 25
  • 51
  • 64
699
votes
29 answers

How to convert a byte array to a hex string in Java?

I have a byte array filled with hex numbers and printing it the easy way is pretty pointless because there are many unprintable elements. What I need is the exact hexcode in the form of: 3a5f771c
Andre
  • 7,860
  • 5
  • 23
  • 30
644
votes
16 answers

How do I get the color from a hexadecimal color code using .NET?

How can I get a color from a hexadecimal color code (e.g. #FFDFD991)? I am reading a file and am getting a hexadecimal color code. I need to create the corresponding System.Windows.Media.Color instance for the hexadecimal color code. Is there an…
viky
  • 16,233
  • 13
  • 65
  • 88
643
votes
49 answers

RGB to hex and hex to RGB

How to convert colors in RGB format to hex format and vice versa? For example, convert '#0080C0' to (0, 128, 192).
Sindar
  • 8,743
  • 6
  • 28
  • 43
584
votes
18 answers

Programmatically Lighten or Darken a hex color (or rgb, and blend colors)

Here is a function I was working on to programmatically lighten or darken a hex color by a specific amount. Just pass in a string like "3F6D2A" for the color (col) and a base10 integer (amt) for the amount to lighten or darken. To darken, pass in a…
Pimp Trizkit
  • 16,888
  • 5
  • 22
  • 37
488
votes
10 answers

Convert integer to hexadecimal and back again

How can I convert the following? 2934 (integer) to B76 (hex) Let me explain what I am trying to do. I have User IDs in my database that are stored as integers. Rather than having users reference their IDs I want to let them use the hex value. The…
codette
  • 11,303
  • 9
  • 35
  • 38
461
votes
4 answers

Why are hexadecimal numbers prefixed with 0x?

Why are hexadecimal numbers prefixed as 0x? I understand the usage of the prefix but I don't understand the significance of why 0x was chosen.
unj2
  • 47,759
  • 80
  • 235
  • 362
398
votes
24 answers

Convert a string representation of a hex dump to a byte array using Java?

I am looking for a way to convert a long string (from a dump), that represents hex values into a byte array. I couldn't have phrased it better than the person that posted the same question here. But to keep it original, I'll phrase it my own way:…
rafraf
  • 4,350
  • 3
  • 17
  • 20
374
votes
4 answers

Need a good hex editor for Linux

I need a good HEX editor for Linux, and by good I mean: Fast Search/replace features Can display data not only in hex, but also binary, octal, etc. Can work with huge (> 1 gb) files without becoming slow and unresponsive (this requirement is…
user500944
365
votes
26 answers

How do I use hexadecimal color strings in Flutter?

How do I convert a hexadecimal color string like #b74093 to a Color in Flutter? I want to use a HEX color code in Dart.
creativecreatorormaybenot
  • 62,078
  • 29
  • 174
  • 277
347
votes
19 answers

byte[] to hex string

How do I convert a byte[] to a string? Every time I attempt it, I get System.Byte[] instead of the value. Also, how do I get the value in Hex instead of a decimal?
user34537
334
votes
13 answers

How to get a Color from hexadecimal Color String

I'd like to use a color from an hexa string such as "#FFFF0000" to (say) change the background color of a Layout. Color.HSVToColor looks like a winner but it takes a float[] as a parameter. Am I any close to the solution at all?
Johann
  • 11,420
  • 10
  • 56
  • 82
1
2 3
99 100