Hyphens. Google has stated for years that it treats hyphens as word separators and underscores as word joiners — so "json_formatter" may be read as one token while "json-formatter" is read as two words. Every major CMS defaults to hyphens for this reason.
How are accented characters handled?
They are transliterated to their base letter, so "Café Naïve" becomes "cafe-naive". This uses Unicode NFKD normalisation to split each character into its base plus combining mark, then strips the marks. A naive strip-non-ASCII approach would produce "caf-nave" and lose the letters entirely.
Should I remove stop words?
Usually not. Shorter slugs are marginally better, but stop words often carry real meaning — "how to format json" and "how format json" read differently, and removing them can make a slug ambiguous. Reach for it only when a slug is genuinely too long.