Welcome to StringLength.org

Your online tool for calculating the length of any string instantly.

Select your language:
Code Examples in Different Languages:
            
            // Python
            str = "Hello, world!"
            length = len(str)

            // JavaScript
            var str = "Hello, world!";
            var length = str.length;

            // Java
            String str = "Hello, world!";
            int length = str.length();

            // C++
            #include <string>
            std::string str = "Hello, world!";
            int length = str.length();

            // C#
            string str = "Hello, world!";
            int length = str.Length;

            // Ruby
            str = "Hello, world!"
            length = str.length

            // PHP
            $str = "Hello, world!";
            $length = strlen($str);

            // Swift
            let str = "Hello, world!"
            let length = str.count

            // Go
            import "unicode/utf8"
            str := "Hello, world!"
            length := utf8.RuneCountInString(str)

            // Rust
            let str = "Hello, world!";
            let length = str.len();