BLAST XML to HTML Converter
Convert NCBI BLAST XML output to formatted, readable HTML reports with color-coded alignments, hit tables, and exportable results.
About
NCBI BLAST produces XML output (format 5 or 14) containing structured alignment data: E-values, bit scores (Sā²), identity percentages, and pairwise sequence alignments. Raw XML is unreadable for quick analysis. Misreading an E-value of 1eā3 versus 1eā30 can lead to false homology assignments or missed orthologs. This tool parses the full BLAST XML schema (BlastOutput ā Iteration ā Hit ā Hsp) and renders it as a formatted HTML report with color-coded residue alignments, sortable hit tables, and highlighted conservation patterns.
The converter handles both single-query and multi-query outputs. Alignment coloring follows standard biochemistry conventions: identical residues in green, positive substitutions (per BLOSUM/PAM matrix context) in yellow, mismatches in red, gaps in gray. Output HTML is self-contained and printable. Note: this tool processes XML client-side. Files exceeding 50 MB may cause browser slowdowns. For metagenomic-scale outputs, consider command-line alternatives.
Formulas
BLAST statistical significance relies on the Karlin-Altschul equation. The E-value represents the expected number of alignments with score ā„ S occurring by chance in a database of given size:
Where K = minor constant (search space scaling), m = effective query length, n = effective database size, Ī» = Gumbel distribution decay constant, S = raw alignment score.
The normalized bit score Sā² allows comparison across different scoring systems:
Identity percentage computed per HSP:
This converter extracts all numeric fields from the XML and renders E-values in scientific notation. Alignment midline characters are parsed: | maps to identity (green), + maps to positive substitution (yellow), space maps to mismatch (red), - in sequences maps to gap (gray).
Reference Data
| BLAST XML Element | Path | HTML Output | Description |
|---|---|---|---|
| BlastOutput_program | BlastOutput/BlastOutput_program | Report header | Program used (blastn, blastp, blastx, tblastn, tblastx) |
| BlastOutput_db | BlastOutput/BlastOutput_db | Report header | Database searched (nr, nt, refseq_protein, etc.) |
| BlastOutput_query-def | BlastOutput/BlastOutput_query-def | Query section title | Query sequence definition line |
| BlastOutput_query-len | BlastOutput/BlastOutput_query-len | Query metadata | Query sequence length in residues/bases |
| Parameters | BlastOutput/BlastOutput_param/Parameters | Parameters table | Matrix, gap costs, expect threshold, filters |
| Iteration_query-def | Iteration/Iteration_query-def | Iteration heading | Query definition for multi-query searches |
| Hit_num | Hit/Hit_num | Hit rank column | Sequential hit number |
| Hit_id | Hit/Hit_id | Accession link | Subject sequence identifier (accession) |
| Hit_def | Hit/Hit_def | Description column | Subject sequence definition/description |
| Hit_len | Hit/Hit_len | Length column | Subject sequence length |
| Hsp_bit-score | Hsp/Hsp_bit-score | Score column | Bit score Sā² (normalized) |
| Hsp_score | Hsp/Hsp_score | Raw score | Raw alignment score |
| Hsp_evalue | Hsp/Hsp_evalue | E-value column | Expect value - statistical significance |
| Hsp_query-from | Hsp/Hsp_query-from | Alignment coords | Start position on query |
| Hsp_query-to | Hsp/Hsp_query-to | Alignment coords | End position on query |
| Hsp_hit-from | Hsp/Hsp_hit-from | Alignment coords | Start position on subject |
| Hsp_hit-to | Hsp/Hsp_hit-to | Alignment coords | End position on subject |
| Hsp_identity | Hsp/Hsp_identity | Identity count | Number of identical residues/bases |
| Hsp_positive | Hsp/Hsp_positive | Positives count | Number of positive-scoring residue pairs |
| Hsp_gaps | Hsp/Hsp_gaps | Gaps count | Total gap characters in alignment |
| Hsp_align-len | Hsp/Hsp_align-len | Alignment length | Total columns in the alignment |
| Hsp_qseq | Hsp/Hsp_qseq | Query alignment row | Query sequence in alignment (with gaps) |
| Hsp_hseq | Hsp/Hsp_hseq | Subject alignment row | Subject sequence in alignment (with gaps) |
| Hsp_midline | Hsp/Hsp_midline | Midline row | Conservation line: | = identity, + = positive, space = mismatch |
| Statistics | Iteration/Iteration_stat/Statistics | Statistics footer | Database size, lambda, kappa, entropy, effective lengths |
Frequently Asked Questions
<BlastXML2> instead of <BlastOutput>, you must re-run BLAST with -outfmt 5.