const span = document.createElement('span'); span.style.position = 'absolute'; span.style.top = '-9999px'; span.style.fontSize = '13px'; span.style.fontFamily = 'Segoe UI'; span.textContent = 'あいうえお'; // 一旦 DOM Tree に append しないといけない document.body.appendChild(span); console.log(span.clientWidth); // 幅を取得したら remove document.body.removeChild(span);