---
title: User-Agent
slug: Web/HTTP/Headers/User-Agent
tags:
  - HTTP
  - HTTP Header
  - HTTP ヘッダー
  - Reference
  - User-agent
translation_of: Web/HTTP/Headers/User-Agent
---
<div>{{HTTPSidebar}}</div>

<p><strong>User-Agent</strong> {{Glossary("request header", "リクエストヘッダー")}}は、サーバーやネットワークピアがアプリケーション、オペレーティングシステム、ベンダーや、リクエストしている{{Glossary("user agent", "ユーザーエージェント")}}のバージョン等を識別できるようにする特性文字列です。</p>

<div class="blockIndicator warning">
<p>ブラウザーによって異なるウェブページやサービスを提供することが、通常は悪い考えである理由については、<a href="/ja/docs/Web/HTTP/Browser_detection_using_the_user_agent">ユーザーエージェント文字列を用いたブラウザーの判定</a>をお読みください。</p>
</div>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">ヘッダー種別</th>
   <td>{{Glossary("Request header", "リクエストヘッダー")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name", "禁止ヘッダー名")}}</th>
   <td>いいえ</td>
  </tr>
 </tbody>
</table>

<h2 id="Syntax" name="Syntax">構文</h2>

<pre class="syntaxbox notranslate">User-Agent: &lt;product&gt; / &lt;product-version&gt; &lt;comment&gt;</pre>

<p>ウェブブラウザーでよくある書式は以下のようなものです。</p>

<pre class="syntaxbox notranslate">User-Agent: Mozilla/5.0 (&lt;system-information&gt;) &lt;platform&gt; (&lt;platform-details&gt;) &lt;extensions&gt;</pre>

<h3 id="Directives" name="Directives">ディレクティブ</h3>

<dl>
 <dt><code>&lt;product&gt;</code></dt>
 <dd>製品の識別子です。名前または開発コードネームです。</dd>
 <dt><code>&lt;product-version&gt;</code></dt>
 <dd>製品のバージョン番号です。</dd>
 <dt><code>&lt;comment&gt;</code></dt>
 <dd>ゼロ個以上のコメントで、サブ製品情報など、より詳細な情報を含みます。</dd>
</dl>

<h2 id="Firefox_UA_string" name="Firefox_UA_string">Firefox の UA 文字列</h2>

<p>Firefox や Gecko ベースのユーザエージェント文字列の詳細については、 <a href="/ja/docs/Web/HTTP/Headers/User-Agent/Firefox">Firefox のユーザエージェント文字列リファレンス</a>を参照してください。 Firefox の UA 文字列は4つの部分に分解されます。</p>

<pre class="notranslate">Mozilla/5.0 (<strong><em>platform</em></strong>; rv:<strong><em>geckoversion</em></strong>) Gecko/<strong><em>geckotrail</em></strong> Firefox/<strong><em>firefoxversion</em></strong></pre>

<ol>
 <li><code>Mozilla/5.0</code> は、 Mozilla と互換性があるブラウザーであるということを示す一般的なトークンで、現在はほぼすべてのブラウザーで共通です。</li>
 <li><strong><em>platform</em></strong> は、ブラウザーが動作しているプラットフォーム (Windows, Mac, Linux, Android など)、およびモバイル端末かどうかを示します。 {{Glossary("Firefox OS")}} のスマートフォンはウェブプラットフォームなので、 <code>Mobile</code> だけです。 <strong><em>platform</em></strong> が複数の "<code>; </code>" という区切りから成っていることに留意してください。後述の詳細と例も併せてご覧ください。</li>
 <li><strong>rv:<em>geckoversion</em></strong> は Gecko のリリースバージョンです ("<em>17.0</em>" など)。最近のブラウザーの <strong><em>geckoversion</em></strong> は <strong><em>firefoxversion</em></strong> と同じです。</li>
 <li><strong><em>Gecko/geckotrail</em></strong> は、ブラウザーが <a href="/ja/docs/Mozilla/Gecko">Gecko</a> を基にしていることを示します。 (デスクトップでは、 <em><strong>geckotrail</strong></em> は常に <code>20100101</code> の固定文字列です。)</li>
 <li><em><strong>Firefox/firefoxversion</strong></em> は、ブラウザーが Firefox であること、またそのバージョン ("<em>17.0</em>" など) を示しています。</li>
</ol>

<h3 id="Examples" name="Examples">例</h3>

<pre class="no-line-numbers notranslate">Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0
Mozilla/5.0 (Macintosh; Intel Mac OS X <em>x.y</em>; rv:42.0) Gecko/20100101 Firefox/42.0
</pre>

<h2 id="Chrome_UA_string" name="Chrome_UA_string">Chrome の UA 文字列</h2>

<p>Chrome (または Chromium/Blink ベースのエンジン) のユーザーエージェント文字列は Firefox のものと似ています。互換性のため、 <code>KHTML, like Gecko</code> や <code>Safari</code> のような文字列が追加されています。</p>

<h3 id="Examples_2" name="Examples_2">例</h3>

<pre class="no-line-numbers notranslate">Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36</pre>

<h2 id="Opera_UA_string" name="Opera_UA_string">Opera の UA 文字列</h2>

<p>Opera ブラウザーも Blink エンジンに基づいているので、大部分は同じですが、 <code>"OPR/&lt;version&gt;"</code> を追加します。</p>

<h3 id="Examples_3" name="Examples_3">例</h3>

<pre class="no-line-numbers notranslate">Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 OPR/38.0.2220.41</pre>

<p>古い Presto ベースの Opera のリリースは、次のものを使用していました。</p>

<pre class="no-line-numbers notranslate">Opera/9.80 (Macintosh; Intel Mac OS X; U; en) Presto/2.2.15 Version/10.00
Opera/9.60 (Windows NT 6.0; U; en) Presto/2.1.1</pre>

<h2 id="Safari_UA_string" name="Safari_UA_string">Safari の UA 文字列</h2>

<p>この例では、ユーザーエージェント文字列はモバイル Safari のものです。これは <code>Mobile</code> という語を含んでいます。</p>

<h3 id="Examples_4" name="Examples_4">例</h3>

<pre class="no-line-numbers notranslate">Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1</pre>

<h2 id="Internet_Explorer_UA_string" name="Internet_Explorer_UA_string">Internet Explorer の UA 文字列</h2>

<h3 id="Examples_5" name="Examples_5">例</h3>

<pre class="no-line-numbers notranslate">Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0)</pre>

<h2 id="Crawler_and_bot_UA_strings" name="Crawler_and_bot_UA_strings">クローラーやボットの UA 文字列</h2>

<h3 id="Examples_6" name="Examples_6">例</h3>

<pre class="no-line-numbers notranslate">Googlebot/2.1 (+http://www.google.com/bot.html)</pre>

<h2 id="Specifications" name="Specifications">仕様書</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">仕様書</th>
   <th scope="col">題名</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{RFC(7231, "User-Agent", "5.5.3")}}</td>
   <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
  </tr>
  <tr>
   <td>{{RFC(2616, "User-Agent", "14.43")}}</td>
   <td>Hypertext Transfer Protocol -- HTTP/1.1</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>

<p>{{Compat("http.headers.User-Agent")}}</p>

<h2 id="See_also" name="See_also">関連情報</h2>

<ul>
 <li><a href="https://hacks.mozilla.org/2013/09/user-agent-detection-history-and-checklist/">User-Agent detection, history and checklist</a></li>
 <li><a href="/ja/docs/Web/HTTP/Headers/User-Agent/Firefox">Firefox ユーザーエージェント文字列リファレンス</a></li>
 <li>
  <p><a href="/ja/docs/Web/HTTP/Browser_detection_using_the_user_agent">ユーザーエージェント文字列を用いたブラウザーの判定</a></p>
 </li>
</ul>