The maximum possible length of an identifier depends on the programming language and environment:
- In C (C99 standard) , the standard requires compilers to recognize at least 63 significant characters in internal identifiers (like local variables or macros) and 31 significant characters in external identifiers (like global variables or function names). However, implementations may support longer identifiers
- In MATLAB , the maximum identifier length for generated code can be set between 31 (default) and 256 characters, depending on model configuration and code generation needs
- In MySQL , the maximum length for most identifiers (database, table, column, index, etc.) is 64 characters, with some exceptions like aliases which can be up to 256 characters
- In Oracle Database , identifier lengths were limited to 30 characters before version 12.2, and from version 12.2 onwards, the default limit is 128 characters
- In Python , there is effectively no fixed maximum length for identifiers. The language itself does not impose a strict limit, and identifiers can be arbitrarily long, limited only by available memory or practical readability. Some sources mention a common style limit of 79 characters for line length, but this is not a language-imposed limit on identifiers
- In JavaScript (ESLint rule) , there are configurable minimum and maximum identifier lengths for code style purposes, but no language-imposed maximum length
Summary Table
Language/Environment| Maximum Identifier Length| Notes
---|---|---
C (C99 standard)| 31 (external), 63 (internal) significant characters|
Implementations may support more13
MATLAB| 31 (default) to 256| Configurable for code generation2
MySQL| 64 (most identifiers), 256 (aliases)| Version dependent5
Oracle DB| 30 (pre-12.2), 128 (12.2+)| Version dependent9
Python| Unlimited (practically no limit)| Limited by memory and
readability6811
JavaScript (ESLint)| Configurable| Style enforcement, no language limit7
Thus, the maximum possible length of an identifier varies widely by language and system, from as low as 30 characters in some databases to effectively unlimited in Python.