ForHosting KIT · Images

RGB to YUV converter

Split an RGB color into brightness and two color differences: orange 255, 128, 0 gives Y 0.5936509804, U −0.2921263922 and V 0.3564952157 with BT.601 weights. Handy for checking video and image-processing math. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Resistance (Ω)
255
G
128
B
0
You get
Y
0.5936509804
U
-0.2921263922
Voltage (V)
0.3564952157
Standard
BT.601

This RGB to YUV converter transforms red, green, and blue channel integers into analog Y′UV luminance and chrominance using fixed BT.601 weights. Enter each channel from zero through 255 and receive normalized Y, U, and V components with stable decimal rounding. The calculation is deterministic and local: it does not call a network service, use randomness, inspect the current time, or silently repair invalid data.

Understand the analog YUV result

RGB describes a color by the intensity of its red, green, and blue channels. Analog Y′UV reorganizes those same signals into one luminance-like component and two color-difference components. The returned y field represents luma: it gives green the greatest influence, red the next greatest, and blue the least, following the familiar BT.601 coefficients 0.299, 0.587, and 0.114.

The u and v fields carry chrominance information. U primarily describes the blue difference, while V primarily describes the red difference. Before applying the matrix, this converter divides each integer channel by 255, so the arithmetic uses normalized R, G, and B values from zero to one.

As a result, Y stays between zero and one. U is approximately bounded by negative 0.436 and positive 0.436, while V is approximately bounded by negative 0.615 and positive 0.615. Neutral grays produce U and V equal to zero because all three normalized channels are equal.

Black therefore becomes YUV zero, zero, zero, and white becomes Y equal to one with zero chrominance. The response repeats the validated source channels, supplies the three rounded components, identifies BT.601 as the standard, and labels the range as normalized analog. This is deliberately an analog Y′UV result, not studio-range digital YCbCr with offsets such as 16 and 128.

That distinction matters when comparing results with video codecs, image libraries, or broadcast tables that may use digital code values under the informal name YUV.

How validation and deterministic calculation work

Provide r, g, and b as integer channel values from zero through 255 inclusive. Numeric strings containing an optional sign and decimal digits are parsed after surrounding whitespace is removed, but decimal fractions, scientific notation, empty values, booleans, arrays, objects, Infinity, and NaN are rejected. Every accepted number must still be an integer in range.

Once validation succeeds, each channel is divided by 255. The converter calculates Y as 0.299R plus 0.587G plus 0.114B, U as negative 0.14713R minus 0.28886G plus 0.436B, and V as 0.615R minus 0.51499G minus 0.10001B. Each result is rounded to ten decimal places, and negative zero is normalized to ordinary zero.

There is no network request, stored state, random input, locale-sensitive parsing, or date dependency.

Use RGB to YUV correctly in media and software workflows

This converter is useful when studying television color models, checking a graphics formula, separating brightness from color differences, or preparing reproducible examples for image and signal-processing code. A media engineer can inspect how primary colors distribute energy between Y, U, and V before working with subsampling or transmission concepts. A designer can compare colors with similar luma while observing how their chrominance coordinates differ.

Keep the declared convention beside any stored value: the output uses normalized nonlinear RGB channel signals and an analog BT.601-style Y′UV matrix. It does not add digital offsets, quantize to limited-range video codes, perform chroma subsampling, linearize sRGB transfer curves, convert primaries, or encode a video stream. Software frequently labels YCbCr values as YUV, so a result from a codec library may look different even when both references mention BT.601.

Confirm whether the other system expects full-range or studio-range digital YCbCr, whether it operates on integers or normalized fractions, and which matrix coefficient convention it uses. For interactive checks, the same pure conversion logic runs free in the browser.

Teach luminance and chrominance

Demonstrate how RGB primaries contribute differently to luma and to the two signed color-difference channels.

Validate media pipeline inputs

Reject malformed or out-of-range 8-bit channels before a deterministic RGB-to-YUV processing step.

What does the RGB to YUV converter cost?

It is free to run in the browser.

Is this analog YUV or digital YCbCr?

It is normalized analog Y′UV using fixed BT.601-derived weights. It does not add digital video offsets or limited-range code values.

What input range is accepted?

Each r, g, and b channel must be an integer from 0 to 255 inclusive.

Why can U and V be negative?

U and V are signed color-difference signals centered on neutral gray. Their sign indicates direction along blue-difference and red-difference chrominance axes.

Does the converter clamp invalid channels?

No. Clamping can hide upstream mistakes, so a channel below 0 or above 255 returns an error instead of changing the requested color.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/color/rgb-yuv

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/color/rgb-yuv \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"r":255,"g":128,"b":0}'
{
  "r": 255,
  "g": 128,
  "b": 0
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "color.rgb_yuv",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Values outside the legal channel range return an invalid_input error instead of being clamped. Use the browser tool for quick checks, or call the API for $0.002 per successful item when applications and test suites need the same reproducible conversion.

How validation and deterministic calculation work

The longer aliases red, green, and blue are accepted, as are capital R, G, and B, which makes the converter easier to connect to forms and tabular data without rewriting field names. A value of 256 or negative one is not clipped to the nearest endpoint, because silent clipping can hide corrupt pixels, incorrect scaling, or a mismatched upstream schema. Fixed coefficients, a fixed operation order, and fixed rounding make repeated calls return the same JSON values on supported runtimes. Failed validation is surfaced as invalid_input with the affected channel named whenever possible.

Use RGB to YUV correctly in media and software workflows

Automated API calls cost $0.002 for each successful item and provide the same deterministic fields. Because invalid channels are rejected rather than modified, this endpoint also works as a strict boundary between loosely formatted input data and a downstream color-processing pipeline.

Create color conversion fixtures

Generate stable BT.601 analog YUV triples for unit tests, golden files, and cross-language implementation checks.

Read the full KIT documentation →