RGB to hex
Shows any colour as hex, RGB, HSL and OKLCH together, so converting is a matter of reading the line you need rather than running a conversion.
How to use the rgb to hex
Hex and RGB are the same numbers written differently; #3366cc is red 51, green 102, blue 204, each pair of hex digits being one channel in base 16. That is why the conversion is exact and lossless in both directions. HSL is a genuine transformation and is where the interesting behaviour lives: it is easy to reason about, and its lightness is not perceptual, so two colours at the same HSL lightness can look very different in weight. OKLCH fixes that, which is why it is worth knowing about even though hex remains the format everything accepts.
Questions
Write each channel in base 16 as two digits. 51 is 33, 102 is 66, 204 is cc, so rgb(51,102,204) is #3366cc.
Between hex and RGB, yes — they are the same numbers. HSL and OKLCH are transformations and can round on the way back.
Its lightness is perceptual, so two colours with the same L look equally light. HSL lightness does not work that way.
Shorthand where each digit is doubled: #36c is #3366cc. Only works when both digits of each pair match.
The last two digits are alpha. #3366ccff is fully opaque.