Base64 maps every 3 bytes to 4 characters, so the encoded size is about 4/3 of the input: a 64-byte ES256 signature becomes 86 characters, a 256-byte RS256 signature 342. JWS, JWE and JWK use base64url without padding (RFC 7515 §2), and so do WebAuthn's id and rawId in JSON, DPoP proofs and SD-JWT disclosures. PEM files and MIME use the standard alphabet with padding and line breaks.
Typical bugs: decoding base64url with a standard base64 decoder (fails on - or _, or silently mangles them), adding or requiring = padding, mixing the two alphabets when moving keys between PEM and JWK, and comparing encoded strings instead of decoded bytes. Strict JOSE parsers reject padding and whitespace inside a compact token.
APIs: Buffer.from(s, "base64url") and buf.toString("base64url") in Node.js; base64.urlsafe_b64encode in Python (it keeps the padding, which you strip); base64.RawURLEncoding in Go; Base64.getUrlEncoder().withoutPadding() in Java.