サービスへ戻る

オンラインSVGエディター

ブラウザ上でSVGコードを編集し、リアルタイムプレビューと保存ができます。

ファイルはブラウザ内で処理 • サーバーへのアップロード不要 • 完成SVGを保存できます。

プレビュー

ファイルなし
SVGをアップロード 読み込み後、画像がここに表示され、コード編集に合わせて更新されます。
サイズ: — ファイル: —

SVGコード

Живое обновление
0 文字 変更は自動で反映されます

このツールについて — オンラインSVGエディター

ブラウザ上でSVGコードを編集し、リアルタイムプレビューと保存ができます。

SVGファイルを読み込むかXMLコードを貼り付け、色・サイズ・文字・線などを変更して結果をすぐ確認し、完成したSVGを保存できます。 このツールはDEVNEW.ORGのWebページ上で直接利用でき、別途ソフトウェアをインストールする必要はありません。サイト運営者、開発者、SEO担当者、デザイナーなど、すばやく使えるオンラインツールが必要な方に便利です。仕事にも個人利用にも無料で使えます。

関連ツール

'; empty.style.display = 'none'; frame.style.display = 'block'; setStatusOk(); updateMeta(result.root, source); } function parseAndSanitize(source) { try { const parser = new DOMParser(); const doc = parser.parseFromString(source, 'image/svg+xml'); const parseError = doc.querySelector('parsererror'); if (parseError) { return { ok: false, error: 'SVGコードに構文エラーがあります。' }; } const root = doc.documentElement; if (!root || root.nodeName.toLowerCase() !== 'svg') { return { ok: false, error: 'コードにはルートの要素が必要です。' }; } sanitizeSvg(root); return { ok: true, root: root, svg: new XMLSerializer().serializeToString(root) }; } catch (e) { return { ok: false, error: 'SVGコードを解析できませんでした。' }; } } function sanitizeSvg(root) { const blockedTags = [ 'script', 'foreignObject', 'iframe', 'object', 'embed', 'audio', 'video' ]; blockedTags.forEach(function (tag) { root.querySelectorAll(tag).forEach(function (node) { node.remove(); }); }); root.querySelectorAll('*').forEach(function (node) { Array.from(node.attributes).forEach(function (attr) { const name = attr.name.toLowerCase(); const value = String(attr.value || '').trim().toLowerCase(); if (name.startsWith('on')) { node.removeAttribute(attr.name); return; } if ( (name === 'href' || name === 'xlink:href') && ( value.startsWith('javascript:') || value.startsWith('http://') || value.startsWith('https://') || value.startsWith('//') ) ) { node.removeAttribute(attr.name); } }); }); } function updateMeta(root, source) { let width = root.getAttribute('width') || ''; let height = root.getAttribute('height') || ''; const viewBox = root.getAttribute('viewBox') || ''; if ((!width || !height) && viewBox) { const values = viewBox.trim().split(/\s+/); if (values.length === 4) { if (!width) width = values[2]; if (!height) height = values[3]; } } dimensions.textContent = 'サイズ: ' + (width && height ? width + ' × ' + height : '未指定'); const bytes = new Blob([source]).size; fileSize.textContent = 'Файл: ' + formatBytes(bytes); } function clearPreview() { frame.srcdoc = ''; frame.style.display = 'none'; empty.style.display = 'block'; status.className = 'svg-status'; status.innerHTML = ' ファイルなし'; dimensions.textContent = 'サイズ: —'; fileSize.textContent = 'ファイル: —'; chars.textContent = code.value.length + ' 文字'; hideError(); } function setStatusOk() { status.className = 'svg-status ok'; status.innerHTML = ' SVGは有効です'; } function setStatusError() { status.className = 'svg-status error'; status.innerHTML = ' Ошибка кода'; } function showError(message) { errorBox.textContent = message; errorBox.style.display = 'block'; } function hideError() { errorBox.textContent = ''; errorBox.style.display = 'none'; } function formatBytes(bytes) { if (bytes >= 1024 * 1024) { return (bytes / 1024 / 1024).toFixed(2) + ' MB'; } if (bytes >= 1024) { return (bytes / 1024).toFixed(2) + ' KB'; } return bytes + ' Б'; } function prettyXml(xml) { xml = xml.replace(/>\s*<'); const nodes = xml.replace(//.test(trimmed)) { pad = Math.max(0, pad - 1); } out += ' '.repeat(pad) + trimmed + '\n'; if ( /^<[^!?/][^>]*[^/]?>$/.test(trimmed) && !/^<(path|circle|rect|line|polyline|polygon|ellipse|use|image|stop|br)\b/i.test(trimmed) && !trimmed.includes('