作業フローを簡素化:miniwebtoolを検索。
追加
関連ツール
CSS整形ツールCSSボックスシャドウジェネレーターGooglebot クロールサイズチェッカーHTMLからMarkdown変換器画像Base64変換器javascript圧縮/整形ツール🔍 盗作チェッカーSQLフォーマッターXMLからJSONへの変換器YAMLフォーマッター/バリデーター
ホームページ > テキストツール > テキスト変更ツール > HTMLビューティファイア
 

HTMLビューティファイア

無料のオンラインHTMLビューティファイアおよびフォーマッタです。圧縮された、あるいは乱雑なHTMLを、適切なインデント、タグの配置、属性の整理で即座に整形します。クライアントサイドで処理されるため、コードがブラウザの外に出ることはありません。

HTMLビューティファイア
🔒 100% クライアントサイド — コードがブラウザ外に出ることはありません
クイックサンプル
⚡ 圧縮されたHTML 🔀 乱雑なインデント 📐 セマンティックレイアウト 📝 フォーム要素
入力 HTML
出力
インデント:
⚠ タグの警告
    0
    総タグ数
    0
    ユニーク要素
    0
    最大震度
    0
    属性数
    0
    入力 (bytes)
    0
    出力 (bytes)
    ⟨/⟩ タグ内訳
    サイズの変化
    0%
    ', messy: '\n\n\n Blog Post\n \n\n \n
    \n
    \n

    Understanding Flexbox

    \n
    \n Jane Doe\n \n
    \n

    Flexbox is a powerful CSS layout module that makes it easy to design\n flexible responsive layout structures.

    \n

    Key Concepts

    \n
      \n
    • Flex Container
    • \n
    • Flex Items
    • \n
    • Main Axis vs Cross Axis
    • \n
    • Flex Wrap
    • \n
    \n
    \n

    Flexbox changed how we think about CSS layouts forever.

    \n
    \n

    Read more about CSS Grid for two-dimensional layouts.

    \n
    \n
    \n \n', semantic: '\n\n\n \n \n Semantic HTML5 Layout\n\n\n
    \n \n
    \n
    \n
    \n
    \n

    Article Title

    \n

    Published on

    \n
    \n
    \n

    Introduction

    \n

    This article demonstrates semantic HTML5 elements that improve accessibility and SEO.

    \n
    \n HTML5 semantic elements diagram\n
    Semantic elements provide meaning to the document structure.
    \n
    \n
    \n \n \n
    \n
    \n
    \n

    © 2026 My Site. Built with semantic HTML.

    \n
    \n\n', form: 'Registration Form
    Personal Information
    Preferences
    ' }; function hbLoadExample(key) { document.getElementById('htmlInput').value = HB_EXAMPLES[key]; document.getElementById('htmlOutput').value = ''; hbHideStats(); } /* ── Utility Functions ───────────────────── */ function hbClearInput() { document.getElementById('htmlInput').value = ''; document.getElementById('htmlOutput').value = ''; hbHideStats(); } function hbPasteFromClipboard() { navigator.clipboard.readText().then(function(text) { document.getElementById('htmlInput').value = text; }).catch(function() {}); } function hbCopyOutput() { var text = document.getElementById('htmlOutput').value; if (!text) return; var btn = document.getElementById('hbCopyBtn'); navigator.clipboard.writeText(text).then(function() { btn.classList.add('copied'); btn.textContent = '✓ コピー完了'; setTimeout(function() { btn.classList.remove('copied'); btn.textContent = '\u29C9 コピー'; }, 1500); }).catch(function() {}); } function hbDownloadOutput() { var code = document.getElementById('htmlOutput').value; if (!code) return; var blob = new Blob([code], { type: 'text/html' }); var a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = 'beautified.html'; a.click(); URL.revokeObjectURL(a.href); } function hbHideStats() { document.getElementById('hbStatsRibbon').classList.remove('visible'); document.getElementById('hbTagBreakdown').classList.remove('visible'); document.getElementById('hbDiffBar').classList.remove('visible'); document.getElementById('hbWarnings').classList.remove('visible'); } /* ── HTML Element Classifications ─────────── */ var VOID_ELEMENTS = ['area','base','br','col','embed','hr','img','input','link','meta','param','source','track','wbr']; var INLINE_ELEMENTS = ['a','abbr','acronym','b','bdo','big','br','button','cite','code','dfn','em','i','img','input','kbd','label','map','object','output','q','samp','select','small','span','strong','sub','sup','textarea','time','tt','u','var']; var RAW_TEXT_ELEMENTS = ['script','style']; var PRESERVE_ELEMENTS = ['pre','code','textarea','script','style']; /* ── HTML Beautifier Engine ──────────────── */ function hbTokenize(html) { var tokens = []; var i = 0; var len = html.length; while (i < len) { if (html.substr(i, 4) === '', i + 4); if (end === -1) end = len - 3; tokens.push({ type: 'comment', value: html.substring(i, end + 3) }); i = end + 3; } else if (html.substr(i, 9).toUpperCase() === '', i); if (end === -1) end = len - 1; tokens.push({ type: 'doctype', value: html.substring(i, end + 1) }); i = end + 1; } else if (html.substr(i, 9) === '', i + 9); if (end === -1) end = len - 3; tokens.push({ type: 'cdata', value: html.substring(i, end + 3) }); i = end + 3; } else if (html.substr(i, 2) === '', i); if (end === -1) end = len - 1; var tag = html.substring(i + 2, end).trim().toLowerCase(); tokens.push({ type: 'close', tag: tag, value: html.substring(i, end + 1) }); i = end + 1; } else if (html[i] === '<' && i + 1 < len && /[a-zA-Z]/.test(html[i + 1])) { var end = i + 1; var inQuote = false; var quoteChar = ''; while (end < len) { var ch = html[end]; if (inQuote) { if (ch === quoteChar) inQuote = false; } else { if (ch === '"' || ch === "'") { inQuote = true; quoteChar = ch; } else if (ch === '>') break; } end++; } if (end >= len) end = len - 1; var tagContent = html.substring(i + 1, end); var selfClosing = tagContent.charAt(tagContent.length - 1) === '/'; if (selfClosing) tagContent = tagContent.substring(0, tagContent.length - 1); var spaceIdx = tagContent.search(/[\s\/]/); var tagName, attrStr; if (spaceIdx === -1) { tagName = tagContent.trim(); attrStr = ''; } else { tagName = tagContent.substring(0, spaceIdx).trim(); attrStr = tagContent.substring(spaceIdx).trim(); } tagName = tagName.toLowerCase(); var isVoid = VOID_ELEMENTS.indexOf(tagName) !== -1; var attrs = hbParseAttributes(attrStr); tokens.push({ type: 'open', tag: tagName, attrs: attrs, selfClosing: selfClosing || isVoid, isVoid: isVoid, raw: html.substring(i, end + 1) }); i = end + 1; if (RAW_TEXT_ELEMENTS.indexOf(tagName) !== -1 && !selfClosing && !isVoid) { var closeTag = ''); return parts.join(''); } function hbBeautifyCode(html, opts) { var indent = opts.indent || ' '; var sortAttrs = opts.sortAttrs || false; var removeComments = opts.removeComments || false; var preserveInline = opts.preserveInline !== false; var tokens = hbTokenize(html); var output = []; var level = 0; var preserveStack = 0; function addIndent(d) { var r = ''; for (var j = 0; j < d; j++) r += indent; return r; } function isInline(tagName) { return preserveInline && INLINE_ELEMENTS.indexOf(tagName) !== -1; } function isPreserve(tagName) { return PRESERVE_ELEMENTS.indexOf(tagName) !== -1; } for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; if (token.type === 'comment') { if (!removeComments) { if (preserveStack > 0) { output.push(token.value); } else { output.push(addIndent(level) + token.value); } } } else if (token.type === 'doctype') { output.push(token.value); } else if (token.type === 'cdata') { output.push(addIndent(level) + token.value); } else if (token.type === 'open') { var tag = hbBuildTag(token.tag, token.attrs, token.selfClosing, sortAttrs); if (preserveStack > 0) { output.push(tag); if (isPreserve(token.tag) && !token.selfClosing) preserveStack++; } else if (isInline(token.tag)) { if (output.length > 0) { var last = output[output.length - 1]; var lastNewline = last.lastIndexOf('\n'); var lastLine = lastNewline === -1 ? last : last.substring(lastNewline + 1); if (lastLine.trim() && !lastLine.trim().match(/^<\/(div|section|article|main|header|footer|nav|aside|ul|ol|li|table|tr|td|th|thead|tbody|tfoot|form|fieldset|dl|dt|dd|details|summary|figure|figcaption|blockquote|p|h[1-6]|pre|hr)>/i)) { output[output.length - 1] = last + tag; } else { output.push(addIndent(level) + tag); } } else { output.push(addIndent(level) + tag); } } else { output.push(addIndent(level) + tag); if (!token.selfClosing) { if (isPreserve(token.tag)) preserveStack++; level++; } } } else if (token.type === 'close') { if (preserveStack > 0) { if (isPreserve(token.tag)) preserveStack--; output.push(''); } else if (isInline(token.tag)) { if (output.length > 0) { output[output.length - 1] = output[output.length - 1] + ''; } else { output.push(''); } } else { level--; if (level < 0) level = 0; output.push(addIndent(level) + ''); } } else if (token.type === 'text') { if (preserveStack > 0 || token.preserve) { output.push(token.value); } else { var text = token.value; var trimmed = text.replace(/\s+/g, ' ').trim(); if (trimmed) { var prevToken = i > 0 ? tokens[i - 1] : null; var nextToken = i < tokens.length - 1 ? tokens[i + 1] : null; var prevIsInline = prevToken && ((prevToken.type === 'open' && isInline(prevToken.tag)) || (prevToken.type === 'close' && isInline(prevToken.tag))); var nextIsInline = nextToken && ((nextToken.type === 'open' && isInline(nextToken.tag)) || (nextToken.type === 'close' && isInline(nextToken.tag))); if (prevIsInline || nextIsInline) { if (output.length > 0) { output[output.length - 1] = output[output.length - 1] + trimmed; } else { output.push(trimmed); } } else { output.push(addIndent(level) + trimmed); } } } } } var result = output.join('\n'); result = result.replace(/\n{3,}/g, '\n\n'); return result.trim(); } function hbMinifyCode(html) { html = html.replace(//g, ''); html = html.replace(/>\s+<'); html = html.replace(/\s+/g, ' '); return html.trim(); } /* ── Stats Calculation ───────────────────── */ function hbGetStats(html) { var stats = { totalTags: 0, uniqueTags: {}, maxDepth: 0, attrCount: 0, warnings: [], tagTypes: { block: {}, inline: {}, void_el: {}, semantic: {} } }; var SEMANTIC = ['article','aside','details','figcaption','figure','footer','header','main','mark','nav','section','summary','time']; var BLOCK = ['div','p','h1','h2','h3','h4','h5','h6','ul','ol','li','table','tr','td','th','thead','tbody','tfoot','form','fieldset','legend','blockquote','pre','dl','dt','dd','hr']; var tokens = hbTokenize(html); var stack = []; var depth = 0; for (var i = 0; i < tokens.length; i++) { var t = tokens[i]; if (t.type === 'open') { stats.totalTags++; stats.uniqueTags[t.tag] = (stats.uniqueTags[t.tag] || 0) + 1; if (t.attrs) stats.attrCount += t.attrs.length; if (SEMANTIC.indexOf(t.tag) !== -1) { stats.tagTypes.semantic[t.tag] = (stats.tagTypes.semantic[t.tag] || 0) + 1; } else if (VOID_ELEMENTS.indexOf(t.tag) !== -1) { stats.tagTypes.void_el[t.tag] = (stats.tagTypes.void_el[t.tag] || 0) + 1; } else if (INLINE_ELEMENTS.indexOf(t.tag) !== -1) { stats.tagTypes.inline[t.tag] = (stats.tagTypes.inline[t.tag] || 0) + 1; } else { stats.tagTypes.block[t.tag] = (stats.tagTypes.block[t.tag] || 0) + 1; } if (!t.selfClosing) { stack.push(t.tag); depth = stack.length; if (depth > stats.maxDepth) stats.maxDepth = depth; } } else if (t.type === 'close') { stats.totalTags++; var found = false; for (var j = stack.length - 1; j >= 0; j--) { if (stack[j] === t.tag) { for (var k = stack.length - 1; k > j; k--) { stats.warnings.push('閉じられていない <' + stack[k] + '> タグがあります'); } stack.splice(j); found = true; break; } } if (!found) { stats.warnings.push('予期しない閉じタグ があります'); } } } for (var s = 0; s < stack.length; s++) { stats.warnings.push('閉じられていない <' + stack[s] + '> タグがあります'); } return stats; } /* ── Display Functions ───────────────────── */ function hbShowStats(inputHtml, outputHtml) { var stats = hbGetStats(inputHtml); var inputSize = new Blob([inputHtml]).size; var outputSize = new Blob([outputHtml]).size; document.getElementById('hbStatTags').textContent = stats.totalTags; document.getElementById('hbStatUnique').textContent = Object.keys(stats.uniqueTags).length; document.getElementById('hbStatDepth').textContent = stats.maxDepth; document.getElementById('hbStatAttrs').textContent = stats.attrCount; document.getElementById('hbStatInputSize').textContent = hbFormatSize(inputSize); document.getElementById('hbStatOutputSize').textContent = hbFormatSize(outputSize); document.getElementById('hbStatsRibbon').classList.add('visible'); var grid = document.getElementById('hbTagGrid'); grid.innerHTML = ''; var types = [ { obj: stats.tagTypes.semantic, cls: 'tag-pill-semantic', label: 'semantic' }, { obj: stats.tagTypes.block, cls: 'tag-pill-block', label: 'block' }, { obj: stats.tagTypes.inline, cls: 'tag-pill-inline', label: 'inline' }, { obj: stats.tagTypes.void_el, cls: 'tag-pill-void', label: 'void' } ]; var hasAny = false; for (var t = 0; t < types.length; t++) { var keys = Object.keys(types[t].obj).sort(); for (var k = 0; k < keys.length; k++) { hasAny = true; var pill = document.createElement('span'); pill.className = 'tag-pill ' + types[t].cls; pill.innerHTML = '<' + keys[k] + '> ' + types[t].obj[keys[k]] + ''; grid.appendChild(pill); } } if (hasAny) { document.getElementById('hbTagBreakdown').classList.add('visible'); } if (stats.warnings.length > 0) { var list = document.getElementById('hbWarningsList'); list.innerHTML = ''; var unique = []; var seen = {}; for (var w = 0; w < stats.warnings.length; w++) { if (!seen[stats.warnings[w]]) { seen[stats.warnings[w]] = true; unique.push(stats.warnings[w]); } } for (var u = 0; u < unique.length && u < 10; u++) { var li = document.createElement('li'); li.textContent = unique[u]; list.appendChild(li); } document.getElementById('hbWarnings').classList.add('visible'); } var pct, isShrink; if (inputSize === 0) { pct = 0; isShrink = true; } else { var change = ((outputSize - inputSize) / inputSize) * 100; isShrink = change < 0; pct = Math.abs(change); } var fill = document.getElementById('hbDiffFill'); var cappedPct = Math.min(pct, 100); fill.style.width = cappedPct + '%'; fill.className = 'diff-fill ' + (isShrink ? 'shrink' : 'grow'); document.getElementById('hbDiffValue').textContent = (isShrink ? '-' : '+') + pct.toFixed(1) + '%'; document.getElementById('hbDiffBar').classList.add('visible'); } function hbFormatSize(bytes) { if (bytes < 1024) return bytes + ''; return (bytes / 1024).toFixed(1) + 'K'; } /* ── Main Actions ────────────────────────── */ function hbBeautify() { var input = document.getElementById('htmlInput').value; if (!input.trim()) return; var indentSel = document.getElementById('hbIndentSize').value; var indent; if (indentSel === 'tab') indent = '\t'; else indent = new Array(parseInt(indentSel) + 1).join(' '); var opts = { indent: indent, sortAttrs: document.getElementById('hbOptSortAttrs').checked, removeComments: document.getElementById('hbOptRemoveComments').checked, preserveInline: document.getElementById('hbOptPreserveInline').checked }; var output = hbBeautifyCode(input, opts); document.getElementById('htmlOutput').value = output; hbShowStats(input, output); } function hbMinify() { var input = document.getElementById('htmlInput').value; if (!input.trim()) return; var output = hbMinifyCode(input); document.getElementById('htmlOutput').value = output; hbShowStats(input, output); }

    Embed HTMLビューティファイア Widget

    HTMLビューティファイア

    このコンテンツ、ページ、またはツールを引用する場合は、次のようにしてください:

    "HTMLビューティファイア"(https://MiniWebtool.com/ja/htmlビューティファイア/) MiniWebtool からの引用、https://MiniWebtool.com/

    by miniwebtool チーム. 更新日: 2026-03-07

    テキスト変更ツール:

    おすすめ:

    InstagramユーザーID検索弧長電卓パーセント増加電卓パーセンテージ減少電卓不可視文字除去ツールMACアドレス検索ランダムカラージェネレーター円錐展開図テンプレートジェネレーター画像分割ツール英単語ランダム生成ツールシグマ記法電卓 総和水星逆行カレンダー合計電卓エンジェルナンバー電卓フィートとインチからセンチメートルへのコンバーターパーセント誤差電卓ランダム誕生日ジェネレーター動画を結合平方完成電卓標準偏差電卓 - 高精度YouTubeチャンネル統計クロスワードパズルメーカー動画を逆再生売上総利益率電卓HEX電卓ランダム超能力ジェネレーターASCIIコード表ai句読点追加筆算割り算電卓土星回帰電卓相対標準偏差電卓番号を並べ替えるCAGR電卓コラッツ予想電卓war電卓私のIPアドレスは何ですかMP3ルーパー楕円円周電卓空の行を削除する関数電卓手数料電卓FPSコンバーター💧 露点電卓動画を回転ビンゴカードジェネレーターランダム絵文字ジェネレーターじゃんけんジェネレーターマン・ホイットニーのU検定計算機対数電卓相関係数計算機kva計算機デシベル (dB) 電卓HEXコンバーターモジュロ電卓中央値電卓熱膨張計算機ボウリングスコア計算機逆テキストBUN対クレアチニン比電卓オンライン句読点削除ツールビデオ速度を調整圧力電卓t検定電卓血糖値コンバーターマスターナンバー電卓ボルト締付トルク計算機労働時間計算ツール角速度計算機ランダムトーナメント表作成ツールランダム名前ジェネレーターfena電卓比率電卓指数電卓-高精度加速度電卓GIFメーカー分数電卓センチメートルからフィートとインチへのコンバーターSRT 時間シフト 電卓コラージュメーカー平方根電卓オーディオ スプリッター求人検索log-base-2電卓XMLバリデーターボクシングパンチ力計算機ジニ係数電卓文字数による改行最小公倍数電卓迷路ジェネレーターSRTからTXTへの変換ツール小数時間から普通の時間へのコンバーター年の日電卓 - 今日は今年の何日目分散電卓 高精度FIP電卓変動係数電卓TikTok収益計算ツールTwitch収益計算ツール変化率電卓確率分布電卓沸点計算ツールAIテキストヒューマナイザーパレットジェネレーター魔方陣ジェネレーター画像回転ツールランダム時刻ジェネレーター積分電卓赤ちゃんのミルク量計算ピタゴラスの定理電卓サッカーxg期待ゴール電卓角度変換ツールCRC32チェックサム電卓ランダムポーカーハンドジェネレーター三角関数グラフ作成ツール四次方程式計算機ランダム日付ジェネレーター中間日計算機平均寿命電卓FacebookユーザーID検索ノノグラムジェネレーター (ピクロス)ジョルダン標準形電卓ベーカーズパーセント電卓タンジェント電卓並列抵抗電卓水泳ペース計算機ニュートン法電卓外れ値電卓桁数電卓正多角形電卓ワイヤーゲージ電卓平均電卓-高精度VTTからtxtへのコンバーター🖱️ クリックカウンター🔊 トーンジェネレーター円錐台電卓動画から画像抽出ツール筆算足し算・引き算計算機⚔️ DPS電卓Zalgoテキストジェネレーター配当利回り電卓配管流量電卓IPアドレスから16進数への変換ヒジュラ暦変換器ビデオをループ再生ピザ生地計算機太陽位置計算機BCDからバイナリへのコンバーターSHA256 ハッシュジェネレーターアンテナ長計算機バーコードジェネレーター取り消し線テキスト生成ツール密度電卓水分補給計算機パーセント成長率電卓斜辺電卓車両重量配分計算機ANC電卓階段電卓10進数からBCDへのコンバーターグレイコード・バイナリ変換電卓ホームランの打席電卓ランダムトランプカードジェネレーターランダムPIN生成器ランダムアニマルジェネレーター二乗平均平方根電卓日割り家賃計算馬力電卓スリザーリンクパズルジェネレータートルク電卓バイナリ電卓発音IPA変換ツール行番号を追加長方形の電卓CPM 電卓HTMLからテキストコンバータPSIからbarへの変換器ランダムクレジットカードジェネレーター油圧シリンダー推力計算機csvからsrtへ音速計算機YouTubeショート収益化計算ツールエラー関数電卓カラー反転ツールビデオ反転周波数波長変換ツール比較分数電卓滑車システム計算機番号ランダマイザー素数ですか表面積電卓アナグラム生成器🎮 ゲーム感度変換器点つなぎジェネレーター熱伝達計算機DMSから10進数へのコンバーター中間点電卓停止距離計算機愛の相性電卓歩数距離変換電卓重複行削除ツールランダム算数問題ジェネレーターリース買取電卓オクタン価ブレンド電卓2ストロークオイル混合電卓エンジン排気量計算ソファ搬入電卓薪コード計算機空気清浄機CADR電卓除湿機サイズ計算シーリングファンサイズ電卓カーテンサイズ計算機ラグサイズ電卓額縁の掛け高さ計算機テレビ取り付け高さ計算機テレビサイズ電卓池の容量・ライナー電卓プール塩量計算機プール容量計算給湯器サイズ電卓エポキシ樹脂計算機手すり子間隔電卓巾木とトリムの電卓サイディング計算機デッキ用ステインの計算芝生の種計算機芝生電卓アスファルト電卓立方ヤード電卓電線管充填率電卓直列並列コンデンサ電卓誘導リアクタンス計算機部屋の照明計算機ルクスからルーメン電卓ルーメンからワット変換器発電機サイズ計算機mAh Wh 変換器 電卓三相電力計算機アンペアからワット電卓ワットからアンペア電卓直列抵抗計算機摩擦計算機斜面計算機機械的倍率計算機波の速度計算機浮力電卓終端速度計算機ド・ブロイ波長計算機光子エネルギー計算機emc2電卓時間の遅れ計算機ケプラーの第三法則計算機脱出速度計算機万有引力計算機ベール・ランベルトの法則電卓ネルンストの式計算機浸透圧計算機沸点上昇電卓凝固点降下計算パーセント組成計算機規定度計算機質量モル濃度計算機pKa→Ka変換器ヘンダーソン・ハッセルバルヒ電卓理論収量計算機制限反応物計算機電子配置計算機インタラクティブ周期表AI授業計画ジェネレーターAIクイズ作成ツール引用ジェネレーター (APA/MLA/Chicago)出席率計算APスコア計算機ACTスコア計算機SATスコア電卓パーセンテージからCGPA変換器CGPAからパーセンテージへの変換器簡単採点ツール EZ Grader子育て費用計算機おむつサイズ電卓赤ちゃんの名前ジェネレーター赤ちゃんの目の色予測子供のBMIパーセンタイル計算機子供の身長予測ツールhcg倍加時間計算ツール体外受精出産予定日電卓着床計算ツール中国式性別予測カレンダーISO 8601 日付フォーマッターユリウス日変換器昼寝電卓月相電卓日の出&日の入り電卓世界時計日付ローマ数字変換電卓退職カウントダウンソブリエティ計算機ハーフバースデー計算機記念日計算機週番号計算機チップ分配計算機メールマーケティングROI電卓リード獲得単価計算機運転資本計算機youtube収益見積もりツールランダムRPGキャラクタージェネレーター