Programming Language Detector

Paste a code snippet whose language you don't know: the tool applies keyword and characteristic-syntax heuristics to suggest the most likely languages, with a confidence score.

Example:

How it works

The tool searches your snippet for characteristic syntax patterns from each language: keywords (def, public class, SELECT ... FROM), typical symbols ($variable in PHP, <?php, HTML tags, CSS braces) and common functions (console.log, printf, System.out.println). Each pattern found adds points to the corresponding language; the scores are then converted into a relative confidence percentage among candidate languages. This is not a real parser: on a very short or ambiguous snippet, detection can be wrong.

Why are multiple languages proposed?

Some languages share a similar syntax (Java and C#, JavaScript and a JSON snippet, C and C++). The tool displays up to 5 candidates ranked by score so you can decide if the snippet is ambiguous, rather than showing a single potentially wrong result.

Does detection work on a very short snippet?

Not as well: with few recognizable patterns (a single line, no distinctive keyword), the confidence score will be low and the ranking less reliable. For a more accurate result, paste a snippet of at least a few representative lines of the file.

Your code is never sent to a server: the analysis is done entirely in your browser, using local heuristics.