HEX converter, text formatter, gradient builder, batch converter & more
FiveM chat preview
Hello FiveM!
Closest FiveM code
~o~Hello FiveM!~w~Need FiveM scripts that use these colors?
600+ premium scripts with polished UI and notifications.
FiveM uses a tilde-based color code system for in-game text. These codes work in chat messages, notifications, HUD text, and UI elements. The format is always ~x~ where x is the color letter.
The available color codes are: ~r~ (Red), ~b~ (Blue), ~g~ (Green), ~y~ (Yellow), ~p~ (Purple), ~w~ (White), ~s~ (White alt), ~l~ (Black), ~c~ (Grey), ~m~ (Dark Grey), ~u~ (Dark Blue), ~o~ (Orange).
Formatting codes include ~n~ (newline), ~t~ (tab), ~h~ (bold), and ~q~ (italic). Always end your colored text with ~w~ or ~s~ to reset the color.
Color codes can be used in several contexts within FiveM Lua scripts:
The Text Formatter tab above lets you build multi-color messages visually and generates the ready-to-use Lua code for each context.
FiveM chat supports rich text formatting through color codes and special characters. Here are the key formatting rules:
~w~ to prevent color bleeding into subsequent messages.~h~ to make it bold. Example: ~h~Bold text~h~~n~ to create line breaks within a single message.~r~~h~Red Bold~h~~w~Use the Gradient Builder tab to create multi-color gradient text effects that would be tedious to write manually. The tool generates the complete FiveM code string automatically.
Why are my FiveM color codes not working?
The most common cause is using color codes in a context that does not support them. Not all text functions in FiveM support tilde codes. Make sure you are using AddTextComponentString or the chat:addMessage event, not plain print() or native text functions that strip formatting.
Can I use custom HEX colors in FiveM?
FiveM's tilde color system only supports the 10 predefined colors. For custom HEX colors, you need to use SetTextColour(r, g, b, a) before DrawText calls, or use NUI (HTML/CSS) for fully custom colored UI elements.
How do I make gradient text in FiveM?
FiveM does not natively support gradients, but you can simulate them by applying a different color code to each word or character. The Gradient Builder tab above automates this -- it interpolates between your chosen colors and generates the complete code string.
Do color codes work in FiveM notifications?
Yes. Color codes work in notifications created with SetNotificationTextEntry and AddTextComponentString. They also work in subtitles (BeginTextCommandPrint) and HUD text (DrawText). They do not work in all native GTA functions.
What is the difference between ~w~ and ~s~?
~w~ and ~s~ both produce white text and are functionally identical in most contexts. ~w~ is the standard white reset code. ~s~ is an alternative that some older scripts use. Either works for resetting color after a colored segment.